Thursday, 9 May 2013

Sample report page breaks unconditionally and conditionally

Unconditionally page breaks by defining NEW-PAGE.

To program unconditional page breaks, use the NEW-PAGE statement.
REPORT demo_list_new_page LINE-SIZE 40.
TOP-OF-PAGE.
WRITE: 'TOP-OF-PAGE', sy-pagno.
ULINE AT /(17).
START-OF-SELECTION.
DO 2 TIMES.
WRITE / 'Loop:'.
DO 3 TIMES.
WRITE / sy-index.
ENDDO.
NEW-PAGE.
ENDDO.


Conditional page breaks by defining block of lines:

REPORT demo_list_reserve LINE-SIZE 40 LINE-COUNT 8(2).
END-OF-PAGE.
ULINE.
START-OF-SELECTION.
DO 4 TIMES.
WRITE / sy-index.
ENDDO.
DO 2 TIMES.
WRITE / sy-index.
ENDDO.
RESERVE 3 LINES.
WRITE: / 'LINE 1',
/ 'LINE 2',
/ 'LINE 3'.

No comments:

Post a Comment