START-OF-SELECTION
Short Reference
ABAP Syntax START-OF-SELECTION.
What does it do? 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.
Latest notes: 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 classic
screens are called.
Example ABAP Coding
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!`.
cl_demo_output=>display_data( 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.
cl_demo_output=>display_data( 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!`.
cl_demo_output=>display_data( 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.
cl_demo_output=>display_data( text ).
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved