Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Meshes →  Meshes - Mesh Paths →  Meshes - Mesh Path Result →  Meshes - Example of Results of Mesh Paths 

Reflexive Associations in Mesh Paths

This example demonstrates the results of reflexive associations in mesh paths.

Other versions: 7.31 | 7.40 | 7.54

Source Code

    DATA(id) = 1.
    cl_demo_input=>request( CHANGING field = id ).

    DATA(out) = cl_demo_output=>new(
      )->begin_section( 'node'
      )->write( mesh-node ).

    IF line_exists( mesh-node[ id = id ] ).
      out->next_section( '\to_node'
        )->write( VALUE t_itab(
           FOR <node> IN mesh-node\to_node[ mesh-node[ id = id ] ]
              ( <node> ) ) ).

      out->next_section( '\to_node+'
        )->write( VALUE t_itab(
           FOR <node> IN mesh-node\to_node+[ mesh-node[ id = id ] ]
              ( <node> ) ) ).

      out->next_section( '\to_node*'
        )->write( VALUE t_itab(
           FOR <node> IN mesh-node\to_node*[ mesh-node[ id = id ] ]
              ( <node> ) ) ) ##PRIMKEY[BY_PARENT].
    ELSE.
      out->write( `Enter a valid ID ...` ).
    ENDIF.

    out->display( ).

Description

In a reflexive association, the source and target nodes are the same node. A reflexive association implements semantic dependencies between the rows of a mesh node. This example shows the results sets of reflexive associations for an internal table saved in a hierarchical tree structure.

  • Simple reflexive association
‎mesh-node\to_node[ mesh-node[ id = id ] ]
The results set includes all rows in which (in accordance with the ON condition), the column parent_id is the same as the column id of the source. In the tree hierarchy, these are the direct subnodes of the row described using source.
  • Transitive association with +
mesh-node\to_node+[ mesh-node[ id = id ] ]
The results set also includes all further rows for which, based on the first results set, the ON condition is met. In the tree hierarchy, these are all subnodes of the row described using source.
  • Transitive association with *
mesh-node\to_node*[ mesh-node[ id = id ] ]
The results set also includes the row described by source.