Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Diff between end-of-page and Reserve

former_member191468
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

vinod_gunaware2
Active Contributor
0 Kudos

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

5 REPLIES 5

vinod_gunaware2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hai

watch this

Basic form

RESERVE n LINES.

Effect

If there is not enough space left on the current page for at least n lines, this statement starts a new page. n can be a constant (1,2,3,...) or a variable.

Notes

Before starting a new page, the END-OF-PAGE processing is executed. This differs from NEW-PAGE .

If the RESERVE statement does not trigger a new page, output is continued on the current page.

Use BACK to return to the first line you can display after RESERVE .

Note

Performance

The runtime required to execute a RESERVE statement is approx. 1 msn (standardized microseconds).

Thanks & Regards

Sreenivasulu P

Former Member
0 Kudos

hi,

<b>end-of-page</b> : every time the list data reaches the footer region of the page.

<b>RESERVE</b> <n> LINES.

Before starting a new page, the END-OF-PAGE processing is executed. This differs from NEW-PAGE .If the RESERVE statement does not trigger a new page, output is continued on the current page.

Former Member
0 Kudos

Anil,

To program page breaks depending on the number of empty lines left on a page, use the RESERVE statement. That means if you want the last two lines to be left for printing footer you need to use the RESERVE statement.

end-of-page is a event that fires, whe end of page is reached.

Regards,

Ravi

Former Member
0 Kudos

Hi,

Following info can help:

Basic form

END-OF-PAGE.

Effect

List processing event.

The END-OF-PAGE event is executed whenever processing reaches that area when formatting a list page

Note:You specify the size of the END-OF-PAGE area of list pages in the LINE-COUNT parameter of the REPORT statement (e.g. REPORT TEST LINE-COUNT 65(3)). If you do not define a size, the END-OF-PAGE area contains no lines and the event END-OF-PAGE is never executed.

Basic form

RESERVE n LINES.

Effect

If there is not enough space left on the current page for at least n lines, this statement starts a new page. n can be a constant (1,2,3,...) or a variable.

Notes

Before starting a new page, the END-OF-PAGE processing is executed. This differs from NEW-PAGE.

If the RESERVE statement does not trigger a new page, output is continued on the current page.

Use BACK to return to the first line output after RESERVE.

Performance:

The runtime required to execute a RESERVE statement is approx. 1 msn (standardized microseconds).

Regards