Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Classic Lists →  Creating Lists 

SKIP

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


SKIP { [n] 
     | {TO LINE line} }.

Variants

1. SKIP [n].
2. SKIP TO LINE line.

Effect

Positions the list cursor relative to the current line or in any other line.

Variant 1

SKIP [n].

Effect

This statement positions the list cursor relative to the current line. The new line is determined by the value of n. n expects a data object of type i. If the value of n is less than or equal to 0, the statement is ignored. If n is not specified, the statement is executed as if n contains the value 1.

The cursor is positioned as follows:

  • If the line of the current list cursor was set using an output statement (WRITE, ULINE), the list cursor is set the first position of the line that is n lines under the current line.
  • If the lines of the current list cursor was set using a positioning statement (BACK, NEW-LINE, NEW-PAGE, SKIP), the list cursor is set in the current position in the line that is n minus 1 lines under the current line.

Note the following special conditions:

  • If the list cursor cannot be positioned on the current page, a new page is created, which includes any page footers that the current page may have. The list cursor is positioned in the first position of the first line under the page header of the new page.
  • The statement is only executed at the start of the page if this page is the first in a list level, or it was generated using the statement NEW-PAGE.


Note

In most cases, this variant of the statement SKIP works as if it creates n blank lines. You need to ensure, however, that these blank lines have no content that can be formatted by the FORMAT statement. Formattable blank lines can only be generated by the WRITE statement in combination with SET BLANK LINES ON.

Variant 2

SKIP TO LINE line.

Effect

This statement positions the list cursor in the first position of the line on the current page whose number is determined by the value in line. line expects a data object of type i. If the value of line is less than or equal to 0, or larger than the page length defined in sy-linct using the addition LINE-COUNT of the introductory program statement, or NEW-PAGE, the addition TO LINE is ignored and the statement SKIP without additions is executed instead.


Note

If the list cursor is positioned in the first list line using SKIP TO LINE, and the list has a standard page header, the output in the first line is overwritten by the standard header. If, however,the cursor is positioned using SKIP TO LINE in the lines of page headers and page footers that are defined for TOP-OF-PAGE and END-OF-PAGE, the page headers or footers are overwritten.


Example

The first SKIP statement generates a blank line for the event TOP-OF-PAGE. The second SKIP statement positions the list cursor in this line.

REPORT demo_skip NO STANDARD PAGE HEADING. 

DATA sum TYPE i. 

TOP-OF-PAGE. 
  SKIP. 
  ULINE. 

START-OF-SELECTION. 
  DO 10 TIMES. 
    WRITE / sy-index. 
    sum = sum + sy-index. 
  ENDDO. 

  SKIP TO LINE 1. 
  WRITE: 'Numbers with sum' COLOR COL_HEADING, 
         sum               COLOR COL_TOTAL.