7.31 | 7.40 | 7.54
Deletes a single row or multiple rows from the last path node of a mesh path
Note that the addition
TABLE (as in
DELETE) is highly significant for directly specified internal tables and distinguishes different variants of statements from each other.
DELETE TABLE mesh_path table_key.
Deletes precisely one row from the follow-on node of an initial mesh association. In this variant, no path extensions can be specified and the square brackets of the initial mesh association cannot contain any additional conditions. The row to be modified is determined using the table key:
- If the
ONcondition of the mesh association covers all key fields of the table key it uses, the deleted row is determined using the result of the mesh path. Here, only those fields of the
ONcondition are respected that are also key fields.
- If the
ONcondition of the mesh association does not cover the key fields of the table key it uses, the missing key fields must be specified in the addition
table_keyand these are combined with the result of the mesh path. The same can be specified for
table_keyas in the statement
TABLE itabwith a directly specified internal table:
WITH TABLE KEYis used, all key fields not covered by the
ONcondition must be specified. No key fields can be specified that are already covered by the
ONcondition. Furthermore, all fields of the follow-on node used in the
ONcondition must exist in the table key used by the mesh association.
- Only those components are taken from a work area specified using
FROM wathat match the non-covered key fields. All other components are ignored. The work area
wamust be compatible with the row type of the last path node.
USING keyname, this key overrides any
USING KEYs specified in the definition of the mesh association. The row is deleted with respect to this table key and its key fields must be covered in full.
The row is deleted in accordance with the rules of DELETE. If the follow-on node contains multiple rows that match the specified key, the first row found is deleted. If the row to be deleted is not found, nothing is deleted.
The return code
sy-subrc is set in the same way as in the corresponding statement
- If the
ONcondition covers all key fields, the addition
WITH TABLE KEYcannot be specified. The addition
FROM wacan be specified, but is ignored.
- If no explicit table key is specified in the definition of the
ONcondition and in the statement
DELETE TABLE mesh_path, the row is deleted with respect to the primary table key.
- Columns of the follow-on node that are specified in the
ONcondition but are not part of the table key used are either forbidden or ignored in this variant. This means that the row to be deleted cannot be determined beyond the bounds of the table key.
Deletes multiple rows from the last path node of a mesh path
mesh_path. Deletes all rows from the last path node described by the
result of the mesh path.
An additional condition can be specified in the square brackets [ ...
] of each mesh association of the mesh path using the additions
USING KEY and