ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Meshes → Meshes - Using Mesh Paths
INSERT mesh_path
Other versions:
7.31 | 7.40 | 7.54
Syntax
INSERT line_spec INTO TABLE
mesh_path result.
Effect
Inserts rows in the last path node of a mesh path mesh_path
. As in
inserts into a directly specified table using
INTO TABLE
, the position of the inserted rows is determined using the
primary table key. The behavior when duplicate rows are encountered with respect to unique table keys
is also the same. When specifying the inserted rows using
line_spec, the same applies when inserting rows in directly specified tables and they must be compatible with the row type of the last path node.
A set of rows with the row type of the last path node is instantiated from line_spec
and the
result of the mesh path. This set is inserted in
the last path node in accordance with the rules of INSERT
:
- For each row in
line_spec
or for each row in an inserted table, the same number of rows are created as described by the result. If the mesh path contains only the initial associations, one row is created; in the case of path extensions, multiple rows can be created.
- In the new rows, the columns in the
ON
condition of the last association of the mesh path are filled as follows:
- If the mesh path contains only an initial association, each of these columns is filled with the current comparison value from
source
.
- If the mesh path contains path extensions, each of these columns is filled with the value described by the result of the preceding association.
line_spec
.
The following applies when specifying the associations:
- If the mesh path contains only an initial association, the square brackets cannot contain an additional condition.
- If the mesh path contains path extensions, all associations can contain additional conditions, which
can be specified using the additions USING
KEY and
WHERE log_exp
. The square brackets [ ] for the association of the last path extension must be empty.
The number of rows inserted is the number of rows specified in lin_spec
multiplied by the number or rows described in
result. If, due to an additional WHERE
condition, the results set is empty, no rows are inserted.
result
can be used
to specified the output behavior when precisely one row is specified, as in
INSERT
. Since more than one row is always inserted when path extensions are used, the addition result
can only be specified in the following cases:
- If the variant
LINES OF
is not used inline_spec
.
- The mesh path contains only the initial association.
The return code sy-subrc
is set in the same way as in the corresponding statement INSERT
.
Notes
- When
INITIAL LINE
is used to specify an initial row inline_spec
, only those components remain initial that are not specified in theON
condition.
- The square brackets of the association of the last path extension are empty, since it needs only to indicate the mesh node in which the rows are inserted.
Examples
See