Walk me through the events of an executable report in the order they run, from loading the program to the user clicking on the output list.
Say your answer out loud first.
Practise another way
First LOAD-OF-PROGRAM, then INITIALIZATION where I set default values. Before the selection screen appears, AT SELECTION-SCREEN OUTPUT runs, so I can hide or change fields. When the user presses Execute, the AT SELECTION-SCREEN ON field and block events run, then plain AT SELECTION-SCREEN as the last check.
Then START-OF-SELECTION reads and outputs data. TOP-OF-PAGE fires with the first output line, and on the list AT LINE-SELECTION or AT USER-COMMAND react to clicks.
The sequence the ABAP runtime drives:
LOAD-OF-PROGRAM: the program is loaded into the internal session. Rarely used in reports.INITIALIZATION: set start values thatDEFAULTcannot express, for example the first day of last month. It runs after loading and before the selection screen.AT SELECTION-SCREEN OUTPUT: the PBO of the selection screen. Runs before every display, so it is the place forLOOP AT SCREEN/MODIFY SCREEN.- Selection screen PAI, after Enter or Execute:
AT SELECTION-SCREEN ON para/ON END OF selcrit/ON BLOCK/ON RADIOBUTTON GROUP: field-level checks. An error message makes only those fields ready for input again.AT SELECTION-SCREEN: runs last, when all input is in the program. Cross-field checks go here.ON VALUE-REQUEST FOR(F4) andON HELP-REQUEST FOR(F1) run only on those keys;ON EXIT-COMMANDonly on Back, Exit or Cancel.
START-OF-SELECTION: the main block. Any statement not inside another event block lands here implicitly, so write the keyword explicitly.- List events while output is written:
TOP-OF-PAGE(header),END-OF-PAGE(footer, needsLINE-COUNT). - After display:
AT LINE-SELECTION,AT USER-COMMAND, andTOP-OF-PAGE DURING LINE-SELECTIONfor details lists.
INITIALIZATION.
p_from = cl_abap_context_info=>get_system_date( ) - 30.
AT SELECTION-SCREEN ON p_bukrs.
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK' ID 'BUKRS' FIELD p_bukrs ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
MESSAGE e001(zfi) WITH p_bukrs. " only P_BUKRS becomes ready for input
ENDIF.
START-OF-SELECTION.
NEW lcl_report( )->run( ).
What about END-OF-SELECTION? Many prep sites still list it as a standard step. In the ABAP keyword documentation (7.58) it sits under obsolete logical database statements.
It exists for programs linked to a logical database. Without one, it simply runs right after START-OF-SELECTION. Do not use it in new code.
Good practice. Keep event blocks thin and call methods of a local class, because event blocks have no local data.
Validate input in the selection-screen events, not in START-OF-SELECTION, so the user can correct it on the screen. Note that these events belong to classic ABAP; ABAP Cloud has no executable programs.
Gives the order including AT SELECTION-SCREEN OUTPUT and the ON variants, says where validation belongs, and knows END-OF-SELECTION is obsolete outside logical databases.
Recites INITIALIZATION, START-OF-SELECTION, END-OF-SELECTION as if that were the whole list, and validates input in START-OF-SELECTION.
Putting defaults in AT SELECTION-SCREEN OUTPUT: it runs before every display and overwrites what the user typed. Defaults belong in INITIALIZATION.
- What is the difference between INITIALIZATION and AT SELECTION-SCREEN OUTPUT for setting a default?
- Which event runs when the user presses F4 on a field?
- Why does an error message in START-OF-SELECTION behave differently from one in AT SELECTION-SCREEN?
- What runs when the user presses Back on the selection screen?
2 candidate write-ups, 4 official pages and 4 prep guides. Confidence: high. Checked 3 Dec 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Candidate write-up Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Prep guide Gives the question.
- Candidate write-up Gives the question.