Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Diff between end-of-page and Reserve

Hi,

Please explain me the diffrence between end-of-page and Reserve and explain me the significance of Reserve.

Please send me syntax also.

in reports max including basic list is 20.Is there any procedure if 21st list is to be printed.

Regards

Anil Kumar K

Message was edited by: K.Anil Kumar

Message was edited by: K.Anil Kumar

Tags:
Former Member
Former Member replied

To define a page footer, use the END-OF-PAGE event. This event occurs if, while processing a list page, the system reaches the lines reserved for the page footer, or if the RESERVE statement triggers a page break. Fill the lines of the page footer in the processing block following the event keyword END-OF-PAGE:

Syntax

END-OF-PAGE.

WRITE: ....

The system only processes the processing block following END-OF-PAGE if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement (see Determining the Page Length).

Remember to end the processing block following END-OF-PAGE by using an appropriate event keyword, such as START-OF-SELECTION, if you want to start processing the actual list afterwards (see Defining Processing Blocks).

REPORT demo_list_end_of_page LINE-SIZE 40 LINE-COUNT 6(2)

NO STANDARD PAGE HEADING.

TOP-OF-PAGE.

WRITE: 'Page with Header and Footer'.

ULINE AT /(27).

END-OF-PAGE.

ULINE.

WRITE: /30 'Page', sy-pagno.

START-OF-SELECTION.

DO 6 TIMES.

WRITE / sy-index.

ENDDO.

This program consists of three processing blocks. The standard page header is turned off. The page length is set to six lines, where two of them are reserved for the page footer.

To program unconditional page breaks, use the NEW-PAGE statement.

To program page breaks depending on the number of empty lines left on a page, use the RESERVE statement.

<b>Conditional Page Break- Defining a Block of Lines</b>

To execute a page break on the condition that less than a certain number of lines is left on a page, use the RESERVE statement:

Syntax

RESERVE <n> LINES.

This statement triggers a page break if less than <n> free lines are left on the current list page between the last output and the page footer. <n> can be a variable. Before starting a new page, the system processes the END-OF-PAGE event. RESERVE only takes effect if output is written to the subsequent page (the system will not generate an empty page).

The RESERVE statement thus defines a block of lines that must be output as a whole. To find out which additional practical effects a block of lines may have, see Specifying a Relative Position.

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

The list header of the standard page header of this sample program is defined as 'Standard Page Header'. The REPORT statement determines the page length to be eight lines. Two of them are used for the standard page header, another two are reserved for the page footer. The page footer consists of a horizontal line and a blank line. Thus, for outputting the actual list, four lines per page remain. The first DO loop fills these four lines. Then the END-OF-PAGE event occurs, after which the system automatically starts a new page. After the second DO loop, the RESERVE statement triggers the END-OF-PAGE event and a page break, since the number of free lines left on the page is less than three.

regards

vinod

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question