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 ] ]
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 ] ]
source
.
- Transitive association with
*
mesh-node\to_node*[ mesh-node[ id = id ] ]
source
.