To layout a page header individually, you must define it in the processing block following the event keyword TOP-OF-PAGE:
Syntax
TOP-OF-PAGE.
WRITE: ....
The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list. The system processes the statements following TOP-OF-PAGE before outputting the first line on a new page. For information on events and processing blocks, see
Controlling the Flow of ABAP Programs by Events.Remember to end the processing block following TOP-OF-PAGE by using an appropriate event keyword, such as START-OF-SELECTION, if you want to start processing the actual list afterwards (see
The self-defined page header appears beneath the standard page header. If you want to suppress the standard page header, use the NO STANDARD PAGE HEADING option of the REPORT statement:
Syntax
REPORT <rep> NO STANDARD PAGE HEADING.
When you use this statement, the system does not display a standard page header on the pages of a list of program <rep>. If you have defined an individual page header using TOP-OF-PAGE, the system displays it.
During the event TOP-OF-PAGE, you can also fill the system fields SY-TVAR0 to SY-TVAR9 with values that should replace possible placeholders &0 to &9 in the standard page header.
When you scroll vertically, the self-defined page header remains visible as does the standard page header. However, the self-defined page header consists of normal list lines and therefore does not adapt automatically to the window width.
REPORT demo_list_page_heading NO STANDARD PAGE HEADING.
TOP-OF-PAGE.
WRITE: sy-title, 40 'Page', sy-pagno.
ULINE.
WRITE: / 'SAP AG', 29 'Walldorf, ',sy-datum,
/ 'Neurottstr. 16', / '69190 Walldorf/Baden'.
ULINE.
START-OF-SELECTION.
DO 5 TIMES.
WRITE / sy-index.
ENDDO.
This program does not use the standard page header, but one that is self-defined following TOP-OF-PAGE. It is necessary to specify the event keyword START-OF-SELECTION to implicitly end the TOP-OF-PAGE processing block. The output appears as follows:
The self-defined page header consists of six lines. The program title comes from the SY-TITLE system field, the page number from SY-PAGNO. The self-defined page header is not as wide as the list.