END-OF-SELECTION 

This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started. You can use the corresponding event block to process and format the data that the program has stored in internal tables or extracts during the various GET events.

The following program is connected to the logical database F1S.

REPORT EVENT_DEMO.

NODES SPFLI.

DATA: SPFLI_TAB TYPE SORTED TABLE OF SPFLI
WITH UNIQUE KEY CITYFROM CITYTO CARRID CONNID,
SPFLI_LINE TYPE SPFLI.

START-OF-SELECTION.

WRITE 'Demo program for END-OF-SELECTION'.
SKIP.

GET SPFLI FIELDS CARRID CONNID CITYFROM CITYTO.

MOVE-CORRESPONDING SPFLI TO SPFLI_LINE.
INSERT SPFLI_LINE INTO TABLE SPFLI_TAB.

END-OF-SELECTION.

LOOP AT SPFLI_TAB INTO SPFLI_LINE.
WRITE: / SPFLI_LINE-CITYFROM,
SPFLI_LINE-CITYTO,
SPFLI_LINE-CARRID,
SPFLI_LINE-CONNID.
ENDLOOP.

This program fills a sorted table with data from the logical database in the GET SPFLI event, and displays them in a list in the END-OF-SELECTIOn event. Depending on what you enter on the selection screen, the beginning of the list display might look like this: