Application Development and Automation 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: 
Read only

SKIP vs RESERVE

Former Member
0 Likes
2,391

hello,

plz tell me about skip and reserve.

thanks

amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,487

Hello,

Syntax Diagram

RESERVE

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.

Note

Performance:

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

Programming Page Breaks

Syntax Diagram

SKIP

Variants:

1. SKIP.

2. SKIP n.

3. SKIP TO LINE line.

Variant 1

SKIP.

Effect

Outputs a blank line.

Example

The statements

WRITE: 'Text 1 ......'.

SKIP.

WRITE: 'Text 2 ......'.

produce the following output:

Text 1 ......

Text 2 ......

Variant 2

SKIP n.

Effect

Outputs n blank lines.

Note

The SKIP statement is only executed if there are still enough lines on the current page. Otherwise, a new page is started (see NEW-PAGE LINE-COUNT).

At the beginning of a new page, SKIP only generates blank lines if this page is the first page of the list or if this page was explicitly requested by NEW-PAGE. Otherwise, SKIP statements are ignored at the beginning of a page.

At the end of the last list page, SKIP only generates blank lines if there is more output (WRITE, ULINE). Otherwise, SKIP statements are ignored at the end of the last page.

Variant 3

SKIP TO LINE line.

Effect

Moves the output position to the line lin. You can move up or down to any position on the current page. The current page is the page on which the next list line is normally output, i.e. the page displayed after the next new line. The line count starts at 1.

Example

The statements

REPORT TEST NO STANDARD PAGE HEADING.

DATA: LINE TYPE I VALUE 3.

WRITE 'Line 1'.

SKIP TO LINE 5.

WRITE 'Line 5'.

SKIP TO LINE ROW

WRITE 'Line 3'.

produce the following output:

Line 1

Line 3

Line 5

Note

The statement SKIP TO LINE lin is executed only if the contents of lin lie between 1 and the maximum number of lines per page (see NEW-PAGE LINE-COUNT).

Additional help

Creating Lists

Regards,

Vasanth

hello,

plz tell me about skip and reserve.

thanks

amit

7 REPLIES 7
Read only

Former Member
0 Likes
1,487

Hi Amit,

We can generate blank lines on the screen by using the following syntax:

Syntax

SKIP [<n>].

Starting with the current line, this statement generates <n> blank lines on the output screen. If no value is specified for <n>, one blank line is output.

To position the output data in a specific line on the screen, use:

Syntax

SKIP TO LINE <n>.

reserve

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.

sample program

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

Thanks,

Reward If Helpful.

Read only

Former Member
0 Likes
1,488

Hello,

Syntax Diagram

RESERVE

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.

Note

Performance:

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

Programming Page Breaks

Syntax Diagram

SKIP

Variants:

1. SKIP.

2. SKIP n.

3. SKIP TO LINE line.

Variant 1

SKIP.

Effect

Outputs a blank line.

Example

The statements

WRITE: 'Text 1 ......'.

SKIP.

WRITE: 'Text 2 ......'.

produce the following output:

Text 1 ......

Text 2 ......

Variant 2

SKIP n.

Effect

Outputs n blank lines.

Note

The SKIP statement is only executed if there are still enough lines on the current page. Otherwise, a new page is started (see NEW-PAGE LINE-COUNT).

At the beginning of a new page, SKIP only generates blank lines if this page is the first page of the list or if this page was explicitly requested by NEW-PAGE. Otherwise, SKIP statements are ignored at the beginning of a page.

At the end of the last list page, SKIP only generates blank lines if there is more output (WRITE, ULINE). Otherwise, SKIP statements are ignored at the end of the last page.

Variant 3

SKIP TO LINE line.

Effect

Moves the output position to the line lin. You can move up or down to any position on the current page. The current page is the page on which the next list line is normally output, i.e. the page displayed after the next new line. The line count starts at 1.

Example

The statements

REPORT TEST NO STANDARD PAGE HEADING.

DATA: LINE TYPE I VALUE 3.

WRITE 'Line 1'.

SKIP TO LINE 5.

WRITE 'Line 5'.

SKIP TO LINE ROW

WRITE 'Line 3'.

produce the following output:

Line 1

Line 3

Line 5

Note

The statement SKIP TO LINE lin is executed only if the contents of lin lie between 1 and the maximum number of lines per page (see NEW-PAGE LINE-COUNT).

Additional help

Creating Lists

Regards,

Vasanth

Read only

Former Member
0 Likes
1,487

Amit,

Skip means ,it skips one blank line.

skip n. n you can give number of lines.

RESERVE n LINES.

If there is not enough space left on the current page for at least n lines, this statement starts a new page.

Don't froget to reward if useful...

Read only

Former Member
0 Likes
1,487

Hi,

try this example (from ABAP-Docu)

REPORT z_test NO STANDARD PAGE HEADING LINE-COUNT 10(2).

*

START-OF-SELECTION.

DO 5 TIMES.

RESERVE 4 LINES.

WRITE: / '1', / '2', / '3'.

SKIP.

ENDDO.

END-OF-PAGE.

ULINE.

WRITE: 'Test', sy-pagno.

Read only

Former Member
0 Likes
1,487

Skip, just leaves the no. of lines you provide, in output.

But reserve sees that how mauch space is left for the page to end

Suppose you want that ur address should come at last while printing, and should come together on one page, you don't want half of address on one page and another half on another, and you don't know how much data wud be given in output beforehand.

So u use reserve command,

suppose the address takes 6 lines.

now just before writing the address, you write RESERVE 6 LINES.

so now whenever this command is executed, it will see that 6 lines are available for printing, if not then it will go to next page, so ur addess will always be printed together.

Read only

former_member196280
Active Contributor
0 Likes
1,487

SKIP.

Outputs a blank line.

REVERSE

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.

Regards,

SaiRam