Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Program structure →  Modularization Statements →  Event Blocks →  Reporting Events 

START-OF-SELECTION

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


START-OF-SELECTION. 

Effect

This event keyword defines the standard processing block of an executable program. The associated event is triggered by the ABAP runtime environment during the running of an executable program after any standard selection screens have been processed.

In an executable program, all statements that are not declarations and that are listed before the first explicit processing block, or if the program does not contain any explicit processing blocks, then all functional statements of the program, are assigned to an implicit event block START-OF-SELECTION, which is inserted before any explicit START-OF-SELECTION event blocks.


Note

If the program is associated with a logical database, preparatory tasks can be performed in START-OF-SELECTION before the logical database imports the data. If the program is not associated with a logical database, this event block becomes a type of "main program" from which procedures or screens are called.


Example

The following are three executable programs with exactly the same functions:

The first program contains an explicit event block START-OF-SELECTION and shows the recommended spelling.

REPORT test_start_of_selection. 

DATA text TYPE string. 

START-OF-SELECTION. 
  text = `Hello World!`. 
  WRITE text.

In the second program, an assignment is inserted before the first processing block, which forms a second implicit event block START-OF-SELECTION before the explicit event block.

REPORT test_start_of_selection. 

DATA text TYPE string. 

text = `Hello World!`. 

START-OF-SELECTION. 
  WRITE text.

In the third program, there is no explicit processing block. All statements implicitly form the event block START-OF-SELECTION.

REPORT test_start_of_selection. 

DATA text TYPE string. 

text = `Hello World!`. 
WRITE text.

The third program has exactly the same meaning as the first program. The second program, in contrast, would have the following form if expressed explicitly:

REPORT test_start_of_selection. 

DATA text TYPE string. 

START-OF-SELECTION. 
  text = `Hello World!`. 

START-OF-SELECTION. 
  WRITE text.

This means that if the second program contained a WRITE statement before the explicit event block, it would behave differently to the first or third programs with the same WRITE statement, as the statement NEW-LINE is executed at the end of the implicit event block.