Академический Документы
Профессиональный Документы
Культура Документы
SAP ABAP is an event driven programming language, ABAP programs executed based on events not line-
by-line. They are used when data from a number of tables have to be selected and processed before
presenting.
The line size for a particular report can be set by using the addition line-size <size>.
The line count for a particular page can be set by using the addition line-count n (n1). N is the
number of lines for the page and N1 is the number of lines reserved for the page footer. Where
(Line Count 10 (2)) 10-2 = 8 Line for the page and 2 lines reserved for the page footer.
To display any information or error message we add a message class to the program using the
addition: Message-id <message class name>. Message classes are maintained in SE91.
line-size <size>
line-count <n(n1)>
Example:
Report <ZEMPLOYEEINFO> no standard page heading
line-size <50>
line-count 15(2)
E001 (ZMESSAGE).
NITIN JADHAV 1
ABAP Classical Reports
2
Parameters:
Parameters is used to take input from end user or user.
Parameters help one to do dynamic selection. They can accommodate only one value for one cycle of
execution of the program.
Select Options:
A Select-Option is used to input a range of values or a set of values to a program. Select options is used
to take input from end user or user in range. Like 10 To 20.
This event is used to load program into memory for execution and this is the first event in execution
sequence.
Triggered before displaying the selection screen.
NITIN JADHAV 2
ABAP Classical Reports
3
2 Initialization:
This event is used to initialize variables, screen default values and other default actions.
This event is executed before the selection screen is displayed.
Initialization of all the values.
You can assign different values other than the values defaulted on the selection screen.
You can fill your selection screen with some values at runtime.
After the ABAP selection screen code has been processed (i.e. parameters, select-options etc.) but
before these are displayed to the user. So you can use it to initialize input fields of the selection
screen or change the default values of these before the user gets to enter data into them.
Example:
INITIALIZATION.
CITY_FR = 'NEW YORK'.
CITY_TO = 'FRANKFURT'.
CARRID-SIGN = 'I'.
CARRID-OPTION = 'EQ'.
CARRID-LOW = 'AA'.
APPEND CARRID.
DATUM+6(2) = '01'.
3 At Selection-Screen output:
NITIN JADHAV 3
ABAP Classical Reports
4
ENDIF.
ENDIF.
ENDLOOP.
Triggered after processing of the user input on the selection screen. This event verifies the user input
prior to the execution of a program. After processing the user input, the selection screen remains in
the active mode.
4 At Selection-Screen on field:
5 At Selection-Screen:
6 Start-of-Selection.
NITIN JADHAV 4
ABAP Classical Reports
5
7 End-of-Selection:
We can use this event just to state that start-of-selection is ended, this event is used with logical
databases, and logical databases are in HR ABAP only. In normal ABAP we don`t have much
importance.
Syntax: END-OF-SELECTION.
Triggered after the last statement in the START-OF-SELECTON event is executed.
After all the data has been selected this event writes the data to the screen.
8 TOP-OF-PAGE:
9 End-of-Page:
Example:
*&---------------------------------------------------------------------*
*& Report ZCLASSICAL
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZCLASSICAL.
NITIN JADHAV 5
ABAP Classical Reports
6
START-OF-SELECTION.
SELECT MATNR MTART MATKL FROM MARA INTO TABLE IT_MARA WHERE
MTART = S_MTART. “Fetch data from MARA table into Internal table.
LOOP AT IT_MARA INTO WA_MARA. “Movie data from Internal table to Work-area.
WRITE: / WA_MARA-MATNR, WA_MARA-MTART, WA_MARA-MATKL. “ print data
ENDLOOP.
NITIN JADHAV 6