ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Meshes → Meshes - Using Mesh Paths → DELETE mesh_path
Deleting Single Rows in Mesh Paths
This example demonstrates how single rows are deleted in mesh paths.
Other versions:
7.31 | 7.40 | 7.54
Source Code
DATA(out) = cl_demo_output=>new(
)->begin_section( 'Initial node1'
)->write( mesh-node1
)->next_section( 'Initial node2'
)->write( mesh-node2 ).
out->next_section( 'Delete One Line Using ON' ).
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 1 ] ].
out->write( mesh-node2 ).
out->next_section( 'Delete One Line Using ON and WITH KEY' ).
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 2 ] ]
WITH TABLE KEY mkey COMPONENTS col3 = 23.
out->write( mesh-node2 ).
out->next_section( 'Delete One Line Using ON and FROM wa' ).
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 3 ] ]
FROM VALUE line2( col3 = 33 ) USING KEY mkey.
out->write( mesh-node2 ).
out->display( ).
Description
Starting from the filled mesh nodes mesh-node1
and mesh-node2
, single rows from mesh-node2
are deleted:
- Statement
DELETE TABLE
for deleting a row using theON
condition.
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 1 ] ].
mesh-node2
, identified starting with the first row of node
mesh-node1
using the initial association \to_node2
,
is deleted. Since the ON
condition covers the primary key used here, no additional key fields need to be specified.
- Statement
DELETE TABLE
for deleting a row using theON
condition and with an explicitly specified key field.
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 2 ] ]
WITH TABLE KEY mkey COMPONENTS col3 = 23.
mesh-node2
, identified starting with the second row of node
mesh-node1
using the initial association \to_node2
,
is deleted. Since the ON
condition does not cover the secondary key
mkey, the missing key field must be specified using addition WITH TABLE KEY
.
- Statement
DELETE TABLE
for deleting a row using theON
condition and with a key field from the work area.
DELETE TABLE mesh-node1\to_node2[ mesh-node1[ 3 ] ]
FROM VALUE line2( col3 = 33 ) USING KEY mkey.
mesh-node2
, identified starting with the third row of node
mesh-node1
using the initial association \to_node2
,
is deleted. Since the ON
condition does not cover the secondary key mkey
, the missing key field must be specified using addition FROM wa
.