Thursday, December 18, 2008

Reports

REPORTS

Report allow the user to display the entries from the tables as per the selection criteria entered by the user.

A Report contains the Selection Screen and the output list.
Types of Reports:
-> Classical Reports
-> Interactive Reports


Report Processing

The steps in reports is as below:

Start
Initialization
Selection
Read entry
Process Entry
List output

SELECT

The SELECT statement ensures that data is read from the database.In order to read from the database table,following information need to be passed to the database:

-> FROM which database table is the data read? (FROM clause)

-> HOW many lines are read? SINGLE addition allows to select only one line.

-> Which line ir read?WHERE clause determines which columns have to be selected

SYNTAX
SELECT select clause [INTO clause] FROM from clause [WHERE cond1] [GROUP BY fields1] [HAVING cond2] [ORDER BY fields2].

SELECT SINGLE

-> Retrieves only a single record from database.
-> If you know the entire primary key of the record you wish to retrieve, this is faster and efficient.
-> No loop required and also no ENDSELECT.
-> Specify all primary keys

PARAMETERS

Parameters are like DATA statements only difference they allow user inputs.

SYNTAX:

PARAMETERS p.

EG:
Parameter:empid(5) type c default '1000'.
Parameter like zemp_num.

Also there are other options like OBLIGATORY,LOWER-CASE,RADIO BUTTONS etc you can use with it.

SELECT-OPTIONS

  • SELECT-OPTIONS sel FOR f.
  • SELECT-OPTIONS PROGRAM FOR SY-REPID.
  • It creates a selection table containing fields: SIGN,OPTION,LOW,HIGH
  • It gives a range for selection.

SIGN: I/E (INCLUDES/EXCLUDES)

OPTION: EQ,NE,CP,NP,GE,LT,LE,GT

LOW :Lower Limit

HIGH: Higher Limit

WRITE :

This is used to write data on the list.

SYNTAX: WRITE word.

EG:WRITE AT / WORD. "new line

WRITE AT 5 WORD. "column 5

WRITE AT (10) WORD. "output length 10

SKIP

Outputs a blank line.
SYNTAX :

SKIP n " Outputs n blank lines.
SKIP TO LINE line.

No comments:

Post a Comment