ABAP Report Events

by | Sep 25, 2018 | ABAP Beginner

Home » SAP » ABAP » ABAP Beginner » ABAP Report Events

Preface – This post is part of the ABAP Beginner series.

ABAP Report Events: Reporting Events

In ABAP Report Events after Program Constructor Event of ABAP, we have ABAP Reporting Events which occur in a predefined manner. These events are called in a predefined sequence (as mentioned later in this post). These events are only called in Executable reports.

Following are the types of Reporting Events:

EventDescriptionStatus
INITIALIZATIONThis event is called just after LOAD-OF-PROGRAM and used to fix default values and initialize fields
START-OF-SELECTIONThis event is called after the Standard Screens are once processed and is used to write all the functional statements
GET nodeThese are used in reports associated with only logical database and are used to read events of logical databaseObsolete
END-OF-SELECTIONThese are used in reports associated with only logical database and is raised when:

·         When logical database has completed its work

·         Just after START-OF-SELECTION

Obsolete

INITIALIZATION

As discussed above, this event is called just after LOAD-OF-PROGRAM and before any selection screen events; and it is used to fix default values and initialize fields.

Example

PARAMETERS:  p_lan TYPE string.

INITIALIZATION.

p_lan = sy-langu.

***Note: In case a standard selection screen is there, multiple calls are made to the same program based upon user input and interaction. INITIALIZATION is ignored after the first call to the program and in this case to initialize the selection screen explicitly for each call we will have to use the event AT SELECTION-SCREEN OUTPUT.

START-OF-SELECTION

As discussed above, this event is called after the Standard Screens are once processed and it is used to write all the functional statements. By functional statements we mean the actual code/ business logic.

Example

REPORT ztest_report.

DATA:  text TYPE string.

START-OF-SELECTION.

text = ‘Hello World!’.

Write: text.

*** Note: If I will not write START-OF-SELECTION in above program, still the program will construct a block of START-OF-SELECTION implicitly just before the actual code. Thus we can skip writing START-OF-SELECTION, but it is a good practise to use it as it makes the code readable.

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Author