This statement defines an event block, whose event is triggered by the ABAP runtime environment during the creation of a basic list at the following time:
If lines were reserved in the addition
LINE-COUNTof the introductory program statement for a page footer that was reached by a write operation on this page. List output made in the event block is placed in this area. Output statements that exceed the reserved area are ignored.
If no lines were reserved in the addition
LINE-COUNTfor a page footer and the end of page was reached by a write operation on this page. List outputs made in the event block have no effect.
END-OF-PAGE is inended for writing list outputs in the page footer
and is triggered only when the page footer or end of page is reached. Statements such as
NEW-PAGE do not trigger the event.
This program displays a list of flights and creates a page for each connection with a header line and footer line.
REPORT demo_page_header_footer NO STANDARD PAGE HEADING LINE-COUNT 0(1). TYPES: BEGIN OF sflight_tab_type, carrid TYPE sflight-carrid, connid TYPE sflight-connid, fldate TYPE sflight-fldate, END OF sflight_tab_type. PARAMETERS p_carrid TYPE sflight-carrid. DATA: sflight_tab TYPE TABLE OF sflight_tab_type, sflight_wa LIKE LINE OF sflight_tab. DATA lines TYPE i. TOP-OF-PAGE. WRITE: / sflight_wa-carrid, sflight_wa-connid. ULINE. END-OF-PAGE. ULINE. START-OF-SELECTION. SELECT carrid, connid, fldate FROM sflight WHERE carrid = @p_carrid ORDER BY carrid, connid INTO CORRESPONDING FIELDS OF TABLE @sflight_tab. LOOP AT sflight_tab INTO sflight_wa. AT NEW connid. SELECT COUNT( DISTINCT fldate ) FROM sflight WHERE carrid = @sflight_wa-carrid AND connid = @sflight_wa-connid INTO @lines. lines += 3. NEW-PAGE LINE-COUNT lines. ENDAT. WRITE / sflight_wa-fldate. ENDLOOP.