Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Meshes →  Meshes - Using Mesh Paths →  MODIFY mesh_path 

Changing Multiple Rows in Mesh Paths

This example demonstrates how multiple rows are changed 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( 'Modify Multiple Lines Using ON' ).
    MODIFY mesh-node1\_node2[ mesh-node1[ 1 ] ]
      FROM VALUE line2( col3 = 111 ) TRANSPORTING col3.
    out->write( mesh-node2 ).

    out->next_section( 'Modify Multiple Lines Using ON and WHERE' ).
    MODIFY mesh-node1\_node2[ mesh-node1[ 2 ] WHERE col3 > 23 ]
      FROM VALUE line2( col3 = 222 ) TRANSPORTING col3.
    out->write( mesh-node2 ).

    out->display( ).

Description

Starting from the filled mesh nodes mesh-node1 and mesh-node2, multiple rows from mesh-node2 are changed:

  • Statement MODIFY for deleting multiple rows using the ON condition.
MODIFY mesh-node1\_node2[ mesh-node1[ 1 ] ]
  FROM VALUE line2( col3 = 111 ) TRANSPORTING col3.
All rows of the node mesh-node2 identified starting with the first row of the node mesh-node1 using the initial mesh association \_node2 are changed in the third column.
  • Statement DELETE for deleting multiple rows using the ON condition with an additional WHERE condition.
MODIFY mesh-node1\_node2[ mesh-node1[ 2 ] WHERE col3 > 23 ]
  FROM VALUE line2( col3 = 222 ) TRANSPORTING col3.
All rows of the node mesh-node2 identified starting with the second row of the node mesh-node1 using the initial mesh association \_node2 and which meet the additional WHERE condition are changed in the third column.