Entering content frameDetermining the Page Length Locate the document in its SAP Library structure

To determine the page length of an output list, use the LINE-COUNT option of the REPORT statement.

Syntax

REPORT <rep> LINE-COUNT <length>[(<n>)].

This statement determines the page length of the output list of program <rep> as <length> lines. If you specify the optional number <n>, the system reserves <n> lines of the page length for the page footer. Those lines of the page footer that are not filled at the END-OF-PAGE event, appear as blank lines (see Defining a Page Footer).

If you set <length> to zero, the system uses the standard page length (see The Standard List). To adapt the page length to the current window size, see Lists with Several Pages. While the list is created, the system field SY-LINCT contains the current number of lines per page (that is <length>, or 0 for the standard page length).

Caution

Consider that the length of the page header is part of <length>. Thus, for the list itself you can use only <length> minus page header length minus <n> lines. If <length> is less than the page header length, a runtime error occurs.

If during list processing the system reaches the end of the area provided for the actual list, it outputs the page footer, if any, inserts some space, and starts a new page. The space inserted belongs to the list background and is not a line of the list. The SY-PAGNO system field always contains the current page number.

Note

When determining the page length, keep in mind the following points:

Example

The following program is designed to demonstrate the usage of the LINE-COUNT option. Therefore, the different pages of the list appear on one screen page.

REPORT demo_list_line_count LINE-SIZE 40 LINE-COUNT 4.

WRITE:  'SY-LINCT:', sy-linct.
SKIP.

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

This program sets the page length to four lines. It uses the standard page header. Suppose, the standard page header consists of the two-line list header. The output then may look as follows:

This graphic is explained in the accompanying text

The list consists of four pages of four lines each. Each page is made up of the page header and two lines of the actual list. Note the space at the end of each page.

 

 

Leaving content frame