Thursday 9 May 2013

Sample report individual pagelength and page headers and columns headers

Even if you suppress the standard page header by using the NO STANDARD PAGE
HEADING option of the REPORT statement, you can activate the display of the
individual components using WITH-TITLE and WITH-HEADING.

REPORT demo_list_new_page_options LINE-SIZE 40.
WRITE: 'Page', sy-pagno.
NEW-PAGE NO-TITLE.
WRITE: 'Page', sy-pagno.
NEW-PAGE NO-HEADING.
WRITE: 'Page', sy-pagno.
NEW-PAGE WITH-TITLE.
WRITE: 'Page', sy-pagno.
NEW-PAGE WITH-HEADING.
WRITE: 'Page', sy-pagno.

To change the Line size of the individual pages:


REPORT demo_list_new_page_line_c_1 LINE-SIZE 40 LINE-COUNT
0(1).
END-OF-PAGE.
ULINE.
START-OF-SELECTION.
NEW-PAGE LINE-COUNT 5.
DO 4 TIMES.
WRITE / sy-index.
ENDDO.
WRITE: / 'Next Loop:'.
NEW-PAGE LINE-COUNT 6.
DO 6 TIMES.
WRITE / sy-index.
ENDDO.
This program

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'.

Sample report line count, line size, end of page

  REPORT  Z292241_LIST_DISPLAY LINE-SIZE 40 LINE-COUNT 8(2).


WRITE'SY-LINCT:', sy-linct.
SKIP.
DO 6 TIMES.
WRITE / sy-index.
ENDDO.

END-OF-PAGE.
ULINE.
WRITE: /30 'Page', sy-pagno.

Sample report LIST Display code

REPORT demo_list_standard.
TABLES spfli.
SKIP.
ULINE AT /(62).
SELECT * FROM spfli WHERE connid GE 0017
AND connid LE 0400.
WRITE: / sy-vline, spfli-connid, sy-vline,
(15) spfli-cityfrom, 26 sy-vline,
31 spfli-cityto, 51 sy-vline, 62 sy-vline,
/ sy-vline, 8 sy-vline,
spfli-deptime UNDER spfli-cityfrom, 26 sy-vline,
spfli-arrtime UNDER spfli-cityto, 51 sy-vline,
spfli-fltime, 62 sy-vline.
ULINE AT /(62).
ENDSELECT.

WRITE: /10 'SAP *** SAP *** SAP *** SAP *** SAP *** SAP',
/19(43) 'Flight Information System',
/19(43) 'International Connections'.

WRITE, SKIP, and ULINE statements output fields of the table
work area SPFLI as well as horizontal and vertical lines to the list.