‎2007 Jun 21 6:20 AM
i know that reserve statement is used when not enough space left on the current page for atleast n lines it starts a new page
but in a interview how to define the Reserve statement can u please define and tell me...
‎2007 Jun 21 6:21 AM
Hi
reserve n lines where n is the integer
RESERVE 10 lines
This statement creates a page break if there is not enough space left on the current list page between the last output and the page end or page footer, as specified in n. A data object of type i is expected for n. No page break is triggered if the value of n is smaller than or equal to 0.
The page break triggers the list event END-OF-PAGE regardless of whether or not a page footer was defined in the statement introducing the program.
In addition, the statement RESERVE influences the behaviour of the statement BACK.
If the page length is greater than the value of n, you can define line blocks with the statement RESERVE that can only be displayed closed on one side.
Reward points for useful Answers
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Jun 21 6:21 AM
Hi
reserve n lines where n is the integer
RESERVE 10 lines
This statement creates a page break if there is not enough space left on the current list page between the last output and the page end or page footer, as specified in n. A data object of type i is expected for n. No page break is triggered if the value of n is smaller than or equal to 0.
The page break triggers the list event END-OF-PAGE regardless of whether or not a page footer was defined in the statement introducing the program.
In addition, the statement RESERVE influences the behaviour of the statement BACK.
If the page length is greater than the value of n, you can define line blocks with the statement RESERVE that can only be displayed closed on one side.
Reward points for useful Answers
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Jun 21 6:24 AM
Pavan,
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.
Don't forget to reward if useful...
‎2007 Jun 21 6:26 AM
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.
Note
Performance:
The runtime required to execute a RESERVE statement is approx. 1 msn (standardized microseconds).
Regards