Chained Statements

Consecutive statements that have the same initial part can be combined in one chained statement. To do this, the identical initial part is specified once and closed with a colon (:). The remaining parts behind are listed separately, divided by commas (,), and closed with a full-stop (.). During the syntax check and program execution, a chained statement is treated as the respective sequence of individual ABAP-statements.

Hint

The same initial parts are not restricted to the key word.

Example

Typical use of a chained statement:

DATA: BEGIN OF struc,
        col1 TYPE c LENGTH 4,
        col2 TYPE c LENGTH 4,
      END OF struc.

The complete syntax of the four statements is:

DATA BEGIN OF struc.
DATA   col1 TYPE c LENGTH 4.
DATA   col2 TYPE c LENGTH 4.
DATA END OF struc.

Chained statement, in which more than the key word is truncated:

CALL METHOD oref->m1 EXPORTING para = : '1', '2', '3'.

The complete syntax of the three statements is:

CALL METHOD oref->m1 EXPORTING para = '1'.
CALL METHOD oref->m1 EXPORTING para = '2'.
CALL METHOD oref->m1 EXPORTING para = '3'.