Entering content framePage length of individual pages Locate the document in its SAP Library structure

To determine the page length of each page individually, use the NEW-PAGE statement:

Syntax

NEW-PAGE LINE-COUNT <length>.

This statement determines the page length of the subsequent pages as <length>. <length> can be a variable. If you set <length> to zero, the system uses the standard page length ( Structure of the Standard List). The page header is part of the page and thus of the page length.

Caution

You cannot use NEW-PAGE to create or change a page footer. A page footer defined in the REPORT statement (see Determining the Page Length) is kept as such, independent of a NEW-PAGE statement.

For the actual list output, <length> minus the page header length and the page footer length is available.

Note

When using the LINE-COUNT option of the NEW-PAGE statement, refer to the notes in Determining the Page Length.

To adapt the page length to the current window length, set <length> to SY-SROWS. The SY-SROWS system field contains the number of lines of the current window.

Example

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 creates five pages of different lengths. The list header text element is defined as 'Standard Page Header' . The REPORT statement reserves one line of each page for the page footer. The page footer is defined in the END-OF-PAGE event as a horizontal line. The first NEW-PAGE statement sets the page length to 5, the second to 6.

This graphic is explained in the accompanying text

The first NEW-PAGE statement does not start a new page, since no output was written to the list before. The standard page header uses two lines of each page for the list header. The page footer uses one line. For the first DO loop, two lines per page can be used to WRITE output. All page breaks within the DO loop occur automatically as soon as the list processing reaches the page footer. The system then displays the page footer. The second NEW-PAGE creates a page break from page 3 to 4. Here, the END-OF-PAGE event is not processed. For the second DO loop, three lines per page can be used to WRITE output. Page breaks again occur automatically. The page footer appears.

Example

REPORT demo_list_new_page_line_c_2 NO STANDARD PAGE HEADING
                                   LINE-SIZE 40 LINE-COUNT 0(2).

TOP-OF-PAGE.

  WRITE: 'Top of Page', sy-pagno,
           'SY-SROWS:', sy-srows.
  ULINE.

END-OF-PAGE.

  ULINE.
  WRITE: 'End of Page', sy-pagno.

START-OF-SELECTION.

* NEW-PAGE LINE-COUNT SY-SROWS.

  DO 100 TIMES.
    WRITE / sy-index.
  ENDDO.

This program creates one single endless page, since the NEW-PAGE statement is marked as comment:

This graphic is explained in the accompanying text

The system displays as many lines as possible in the current window, which has a length of 12 lines. In the figure above, the 12 lines are made up of two self-defined header lines and 10 lines of the actual list. When you scroll vertically, the page header remains visible. If you remove the asterisk in front of the NEW-PAGE statement and keep the current window length, the output looks as follows:

This graphic is explained in the accompanying text

The list is now separated into several pages where, according to SY-SROWS, each page is 12 lines long. Of these 12 lines, two are reserved for the page header and two for the footer. In this list, the user can scroll explicitly using Next page (for example, to page 11):

This graphic is explained in the accompanying text

 

 

 

Leaving content frame