ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Meshes → Meshes - Using Mesh Paths
DELETE mesh_path
Other versions:
7.31 | 7.40 | 7.54
Syntax
DELETE { TABLE mesh_path table_key }
| { mesh_path }.
Variants
1. DELETE TABLE mesh_path table_key.
2. DELETE mesh_path.
Effect
Deletes a single row or multiple rows from the last path node of a mesh path mesh_path.
Note
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.
Variant 1
DELETE TABLE mesh_path table_key.
Effect
Deletes precisely one row from 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
ONcondition of the 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 theONcondition are respected that are also key fields.
- If the
ONcondition of the association does not cover the key fields of the table key it uses, the missing key fields must be specified in the additiontable_keyand these are combined with the result of the mesh path. The same can be specified fortable_keyas in the statementDELETETABLE itabwith a directly specified internal table:
- If
WITH TABLE KEYis used, all key fields not covered by theONcondition must be specified. No key fields can be specified that are already covered by theONcondition. Furthermore, all fields of the follow-on node used in theONcondition must exist in the table key used by the 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 areawamust be compatible with the row type of the last path node.
table_key
using keynmame COMPONENTS or USING keyname, this
key overrides any USING KEYs
specified in the definition of the 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 DELETE itab.
Notes
- If the
ONcondition covers all key fields, the additionWITH TABLE KEYcannot be specified. The additionFROM wacan be specified, but is ignored.
- If no explicit table key is specified in the definition of the
ONcondition and in the statementDELETE 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.
The return code sy-subrc is not set in this variant.
Example
Variant 2
DELETE mesh_path.
Effect
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 association of the mesh path using the additions
USING KEY and WHERE log_exp.
Example