Ansicht
Dokumentation

ABAPMODIFY_ITAB_SINGLE - MODIFY ITAB SINGLE

ABAPMODIFY_ITAB_SINGLE - MODIFY ITAB SINGLE

rdisp/max_wprun_time - Maximum work process run time   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

MODIFY itab, itab_line

Short Reference



... ${ table_key  $| index $} FROM wa
                          $[TRANSPORTING comp1 comp2 ...$]
$[result$].

Addition:

... TRANSPORTING comp1 comp2 ...

Effect

In this variant, the statement MODIFY assigns the content of work area wa to a line specified by a table key in table_key or a line number in index. wa is a general expression position.

TRANSPORTING can be used to restrict the components comp to be modified. result can be used when changing a single line to set a reference to the changed line in the form of a field symbol or a data reference.

For access using table keys, index access to sorted tables and when the addition TRANSPORTING is used, the wa work area must be compatible with the line type of the internal table. Only when inserting using the primary table index in standard tables without the addition TRANSPORTING can wa be incompatible with the line type of the internal table and 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

  • When modifying a line in a table, the table keys that are read-only must be respected. While the overwriting of protected key fields in the primary table key is not checked until runtime, this always produces a syntax error for the secondary table key. If a line whose secondary table key is read only is changed, FROM wa can therefore only be specified together with TRANSPORTING, and no key fields of the secondary key can be specified after TRANSPORTING.
  • The statement MODIFY itab FROM wa has the statement MODIFY dbtab FROM wa with identical syntax. If an internal table has the same name as a database table, a statement like this accesses the internal table.
  • Outside of classes, an obsolete short form is possible where FROM wa 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.

Addition

... TRANSPORTING comp1 comp2 ...

Effect

The addition TRANSPORTING has the effect that only the specified components comp1, comp2, ... of the work area are assigned to the corresponding components of the lines to be changed. For sorted tables and hashed tables, no primary table key components can be specified after TRANSPORTING.

The components comp1, comp2, ... are specified in accordance with the rules in Specifying Components, with the restriction that, after TRANSPORTING, no attributes of classes can be addressed using the object component selector.

Example

The position of letters from the first column of an internal table is determined in the system field sy-abcde and this value is assigned to the second column. The column is accessed using the table index and the statement MODIFY modifies the second column only.






Fill RESBD Structure from EBP Component Structure   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 6334 Date: 20240329 Time: 082047     sap01-206 ( 87 ms )