Ansicht
Dokumentation

ABAPAPPEND_LINESPEC - APPEND LINESPEC

ABAPAPPEND_LINESPEC - APPEND LINESPEC

rdisp/max_wprun_time - Maximum work process run time   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

APPEND, line_spec

Short Reference



... wa
  $| ${INITIAL LINE$}
  $| ${LINES OF jtab $[FROM idx1$] $[TO idx2$] $[STEP n$] $[USING KEY keyname$]$} ...

Alternatives:

1. ... wa

2. ... INITIAL LINE

3. ... LINES OF jtab $[FROM idx1$] $[TO idx2$] $[STEP n$] $[USING KEY keyname$]

Effect

Either a work area wa, an initial line INITIAL LINE, or multiple lines of an internal table jtab can be appended.

Alternative 1

... wa


Effect

A new line is appended to which the content of the work area wa is assigned. wa is a general expression position. wa may be incompatible with the line type of the internal table and, if necessary, is converted to the line type in accordance with the conversion rules. If a conversion error occurs here, the exception cannot be handled using CX_SY_CONVERSION_ERROR and the associated runtime error occurs instead. If an arithmetic expression is specified for wa, the line type of the internal table is used to determine the calculation type.

Notes

  • If a conflict occurs with an existing unique primary table type, this raises an uncatchable exception when appending a single line. In the case of a conflict with a unique secondary table key, a catchable exception of the class CX_SY_ITAB_DUPLICATE_KEY is raised.
  • Outside of classes, there is also an obsolete short form where wa TO can be omitted if the internal table has an identically named header line itab. The statement then uses the header line as the work area implicitly.

Appending of square numbers to a sorted table with elementary line type.

Alternative 2

... INITIAL LINE


Effect

A new line is appended in which every component contains the type-dependent initial value.

Example

Appending of an initial line that simultaneously is linked to a field symbol using the addition ASSIGNING. This means that initial lines can be processed directly.

Alternative 3

... LINES OF jtab $[FROM idx1$] $[TO idx2$] $[STEP n$] $[USING KEY keyname$]


Effect

The lines of an internal table jtab are appended as a block. jtab is a functional operand position.

The lines to be inserted are taken sequentially from the table jtab. The line type of jtab can be incompatible with the line type of the internal table itab and is converted to the line type of the target table, if necessary, in accordance with the conversion rules. If a conversion error occurs here, the exception cannot be handled using CX_SY_CONVERSION_ERROR and the associated runtime error occurs instead.

The order in which the lines are taken is the same as for the statement LOOP and can also be affected by specifying a table key keyname after USING KEY. The additions FROM idx1 and TO idx2 have the same syntax and effect as for LOOP with respect to jtab. STEP n has the same syntax and effect as for LOOP with the exception that the value of n must be positive.

If a conflict with existing primary or secondary table keys occurs, this always raises an uncatchable exception when multiple lines are appended from an internal table.

Note

When a standard table is constructed, the constructor operators NEW and VALUE can also append multiple lines from a table to the target table using LINES OF.

Example

Appending of the lines of an internal table itab2 to the standard table itab1.

Appending of the lines of an internal table jtab to the standard table itab with the additions FROM, TO, and STEP.








Addresses (Business Address Services)   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 6722 Date: 20240419 Time: 151807     sap01-206 ( 99 ms )