Entering content frame

Determining the Page Length Locate the document in its SAP Library structure

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


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


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.


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

         For screen output, use the standard page length to avoid page breaks in the middle of the screen.

         For printing lists, set the page length according to the printer requirements. Write your program in a way that it produces appropriate output for any page length. If you choose a page length that is not covered by one of the existing print formats, you may no longer be able to directly print a list while creating it. For more information, see Print Parameters.

         Use fixed length specifications for form-like lists of a specified page layout only. Before coding a program for such a list, check whether you can use predefined SAPscript forms. For information on forms, see the documentation Structure linkBC-Style and Layout Maintenance.


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.

  WRITE / sy-index.

This program sets the page length to four lines. It uses the standard page header. Let us suppose that 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