7.31 | 7.40 | 7.54
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
- For each row in
line_specor 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 mesh associations, one row is created; in the case of path extensions, multiple rows can be created.
- In the new rows, the columns in the
ONcondition of the last mesh association of the mesh path are filled as follows:
- If the mesh path contains only an initial mesh association, each of these columns is filled with the current comparison value from
- If the mesh path contains path extensions, each of these columns is filled with the value described by the result of the preceding mesh association.
The following applies when specifying the mesh associations:
- If the mesh path contains only an initial mesh association, the square brackets cannot contain an additional condition.
- If the mesh path contains path extensions, all mesh associations can contain additional conditions,
which can be specified using the additions
USING KEY and
WHERE log_exp. The square brackets [ ] for the mesh 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 OFis not used in
- The mesh path contains only the initial mesh association.
The return code
sy-subrc is set in the same way as in the corresponding statement
INITIAL LINEis used to specify an initial row in
line_spec, only those components remain initial that are not specified in the
- The square brackets of the mesh association of the last path extension are empty, since it needs only to indicate the mesh node in which the rows are inserted.