Leaving Event Blocks Using STOP
If you use the STOP statement within an event block, the system stops processing the block immediately. The ABAP runtime environment triggers the next event according to the following diagram:
Before and during selection screen processing, the next event in the prescribed sequence is always called. From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement. Once the corresponding event block has been processed, the system displays the list.
The following program is connected to the logical database F1S.
REPORT EVENT_TEST.
NODES: SPFLI, SFLIGHT, SBOOK.
START-OF-SELECTION.
WRITE 'Test program for STOP'.
GET SBOOK.
WRITE: 'Bookid', SBOOK-BOOKID.
STOP.
END-OF-SELECTION.
WRITE: / 'End of Selection'.
This produces the following output:
Test Program for STOP
Bookid 00010001
End of Selection
As soon as the first line of SBOOK has been read, the system calls the END-OF-SELECTION event block.