Skip Statement

ABAP had SKIP command to insert blank lines in between the output lines.

Syntax –

SKIP.
SKIP no-of-lines.
SKIP TO LINE line-number.

SKIP – To skip the current line and the next output will display from next line.

SKIP no-of-lines – To skip no-of-lines specified from the current line and the output will start from next line.

SKIP TO LINE line-number – To start the output from line-number specified.

Example –

Display the line numbers message for 3rd, 5th, 10th and 15th lines.

Code –

*&---------------------------------------------------------------------*
*& Report  ZSKIPLINE
*&---------------------------------------------------------------------*
*& Written by TutorialsCampus
*&---------------------------------------------------------------------*

REPORT  ZSKIPLINE.

WRITE 'This is 3rd line'.
SKIP.
WRITE 'This is 5th line'.

SKIP 4.
WRITE 'This is 10th line'.

SKIP TO LINE 15.
WRITE 'This is 15th line'.

Output –

Project Image

Explaining Example –

In the above example, three types of skips explained. First WRITE statement output displays at the line 3. SKIP statement skips the 4th line display. Second WRITE statement output displays at 5th line. So currently the cursor at the 5th line.

SKIP 4 – skips the 4 lines from 5th line and places the cursor at 10th line.Third WRITE statement output displays at 10th line.

SKIP TO LINE 15 – places the cursor at the 15th line. Fourth WRITE statement output displays at 15th line.

Note! As discussed in the previous chapter, the ABAP output displaying from 3rd line. The first line is the program name and the 2nd line for drawing the line.

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *