Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Meshes →  Meshes - Using Mesh Paths 

MODIFY mesh_path

Other versions: 7.31 | 7.40 | 7.54

Syntax


MODIFY { TABLE mesh_path [USING KEY keyname] 
                         FROM wa
                         [TRANSPORTING comp1 comp2 ...]
                         result }
     | { mesh_path FROM wa
                   [TRANSPORTING comp1 comp2 ...] }.

Variants

1. MODIFY TABLE mesh_path FROM wa ...

2. MODIFY mesh_path FROM wa ...

Addition

... TRANSPORTING comp1 comp2 ...

Effect

Modifies a single row or multiple rows in the last path node of a mesh path mesh_path. In the row or rows described by the mesh path, the following columns are assigned the corresponding values from the work area wa:

  • If the optional addition TRANSPORTING is not specified, all columns are modified
  • that are not in theON condition of the association in question,
  • that are no part of the primary key of the last path node, if the table is a sorted table or a hashed table.
  • If the optional addition TRANSPORTING is specified, the columns after it are modified

wa expects a structure that is compatible with the row type of the last path node. No key fields of primary or secondary table keys in the last path node can be overwritten. The return code sy-subrc is set in the same way as in the corresponding statement MODIFY itab.


Note

Note that the addition TABLE (as in MODIFY) is highly significant for directly specified internal tables and distinguishes different variants of statements from each other.

Variant 1

MODIFY TABLE mesh_path FROM wa ...

Effect

Modifies precisely one row in the follow-on node of an initial association. In this variant, no path extensions can be specified and the square brackets of the initial association cannot contain any additional conditions. The row to be modified is determined using the table key:

  • If the ON condition of the association covers all key fields of the table key it uses, the modified row is determined using the result of the mesh path. Here, only those fields of the ON condition are respected that are also key fields.
  • If the ON condition of the association in question does not cover the key fields of the table key it uses, the missing key fields are taken from the associated components of the work area wa.

The row is modified in accordance with the rules of MODIFY. If the follow-on node contains multiple rows that match the specified key, the first row found is modified. If the row to be modified is not found, nothing is modified. The key in question can be specified using the addition USING KEY, just as in the statement MODIFY with directly specified internal table. result can be used to specify the output behavior.


Note

Columns of the follow-on node that are specified in the ON condition but are not part of the table key used are always ignored in this variant. This means that the row to be modified cannot be determined beyond the bounds of the table key.


Variant 2

MODIFY mesh_path FROM wa ...

Effect

Modifies multiple rows in the last path node of a mesh path mesh_path. Modifies all rows in the last path node described by the result of the mesh path. An additional condition can be specified in the square brackets [ ... ] of each association of the mesh path using the additions USING KEY and WHERE log_exp. In the last association, the addition USING KEY cannot be specified if it is specified after FROM wa.


Addition

... TRANSPORTING comp1 comp2 ...

Effect

The same applies to the addition TRANSPORTING as to the statement MODIFY with directly specified internal table, with the restriction that no columns can be specified that are part of the primary key of the last path node if the table is a sorted table or hashed table.


Note

The TRANSPORTING addition can also be used to modify columns that are specified in the ON condition of the association in question.

Continue

Changing Single Rows in Mesh Paths - Example

Changing Multiple Rows in Mesh Paths - Example