SAP ABAP Classical Reports
SAP ABAP Classical Reports are the most basic ABAP reports that contain both selection screen and an output screen. Classical reports are executed based on events, and not executed on a line-by-line basis. Classical reports are non-interactive reports. Basically, they consist of one program that creates a single list.
The following SAP training tutorials guides various events in classical reports, provide the syntax for each and then present a simple programming example of a Classical Report.
Events in Classical Reports.
The following are the list of Events in Classical Reports.
The Load-of-program event loads the program into memory for execution. Always, Load-of-program is the first event in execution sequence.
Initialization is an event that is used for initialize variables, screen values and other default actions.
3. At Selection-Screen output
One of the selection screen events is used to manipulate dynamic selection-screen changes.
4. At Selection-Screen on field
It is used to validates the screen input parameter.
5. At Selection-Screen on value request
This selection screen event allows for a value help or field help for an input field.
6. At Selection-Screen on help request
This selection screen event enables function key F1 help for a input field.
7. At Selection-Screen
Selection screen validates various input fields.
This is the default event in any ABAP program and is activated whether we use it explicitly or not .
This event signals that event of what has been initiated by the start-of-selection event.
This event is used to print the same heading for all pages.
This event is used to print the same footer for all pages.
The below simple programming example shows how an typical Classical Report is written:
DATA : WA_MARA LIKE MARA.
**FIRST MARA IS DATABASE TABLE SECOND MARA IS DEFAULT STRUCTURE
*SELECT SINGLE * FROM MARA INTO MARA.
* SELECT SINGLE * FROM MARA INTO MARA WHERE matnr EQ ‘000000000000000023’.
SELECT SINGLE * FROM MARA INTO MARA WHERE matnr EQ ‘000000000000000023’.
IF SY-SUBRC EQ 0.
WRITE :/10 ‘SELECT SUCCESSFUL’.
move-CORRESPONDING mara to wa_mara.
WRITE :/10 ‘SELECT NOT SUCCESSFUL’.
if WA_mara is not INITIAL.
WRITE /10 : WA_MARA-MATNR, “MATERIAL NUMBER
WA_MARA-MTART, “MATERIAL TYPE
WA_MARA-MBRSH, “INDUSTRY SECTOR
WA_MARA-MATKL. “MATERIAL ID
write :/10 ‘wa_mara is empty…’.