ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Meshes → Meshes - Mesh Paths → Meshes - mesh_path
Meshes - \assoc[ ... ]
7.31 | 7.40 | 7.54
... \to_node[+|][ ... ]
| \to_node~node[+|][ ... ]
| \^to_node~node[+|*][ ... ] ...
Specifies an association in a mesh path. If specified,
an association is introduced using a backslash character,
\, and is always
directly to the right of a source node of the mesh path. An association leads from its source node to
a follow-on node in the same mesh. An association is either an initial association,
\associ[ ... ], in which the source node of the explicitly specified
root node is at the start of a mesh path, or it is a path extension, \assoc1[ ...
\assoc2[ ... ], ..., in which the source node is the follow-on node of a preceding association.
The syntax variants defined whether the association is a forward association or an inverse association..
The addition in square brackets defines the table row of the source node from which the association
originates at runtime. The optional additions
* can be used to make associations transitive.
In the definition of an association, its nodes are known as start and target nodes. In evaluations, however, they are known as source and follow-on nodes. In a forward association, the source node is always a start node and the follow-on node is always a target node. In inverse associations, the reverse applies.
Specifies a forward association In a forward association, the source node is a start node and the follow-on
node is a target node of an association
to_node of the mesh. Both variants have the same semantics.
to_node is used to specify the name of an association defined for the source node in the
mesh type. The follow-on node is the target node of this
association and can be specified as
~ in alternative 2.
The follow-on node
node can be specified explicitly for logging purposes
(on the consumer side). If the recommended naming convention with the prefix
to_ in front of the name of the target node is used for
associations, however, it is redundant.
Specifies an inverse association. In an inverse association, the source node is a target node and the
follow-on node is a start node of an association
to_node of the mesh.
to_node is used to specify the name of an association that has the source node as a target node in the
mesh type. The start node of the association in question
must be specified explicitly as the follow-on node using
- The follow-on node
nodemust be specified since the source node can be the target node of various associations of a mesh type with the same name.
- An inverse association can also be specified for a reflexive association with the same start node and target node.
Forward associations and an inverse association as initial associations of mesh paths.
BEGIN OF MESH mesh,
node1 TYPE REF TO itab1 ASSOCIATION assoc TO node2 ON ...
node2 TYPE REF TO itab2,
END OF MESH mesh.
DATA(mesh) = VALUE mesh( ... ).
... mesh-node1\assoc[ ... ] ...
... mesh-node1\assoc~node2[ ... ] ...
... mesh-node2\^assoc~node1[ ... ] ...
... [ ... ]
The square brackets are part of the syntax. The square brackets define the table row of the source node from which the association originates at runtime. This information is determined by whether the association is an initial association or a path extension and where the mesh path is used:
[ source [cond] ]
sourceas a source in an initial association
\associ[ ... ].
[ [cond] ]
\assoc2[ ... ]. The source is the result of the preceding association.
Depending on where the association is used, further conditions
cond can be specified. If no further conditions are specified, the square
brackets of an initial association contain only
source and the square brackets of a path extension are empty.
* can be specified after the
name of the association to make it transitive. To be used transitively, the association
to_node must be reflexive and have the same start and target node. If
the last association in the mesh path is used transitively, it can only be used for single rows with
If an association is used transitively, it is evaluated more than once when the mesh path is used. First, the regular result of the association is determined. Starting with this result, the association is evaluated recursively until no new rows are found in the follow-on node. Here, the result of each evaluation is the starting point of the next recursion. The results set of the transitive association is the union set of the individual recursions
* differ as follows:
+is specified, the results set is only determined by the results of the associations.
*is specified, the source of the association is included in the results set. If the association is the initial association, the row is determined from the specified source
sourceusing the primary table key and it cannot be empty. If no rows are found, the results set is empty.
Each row of the follow-on node occurs only once in the results set, even if it was found more than once when the mesh path was evaluated.
- Transitive associations are useful for evaluating hierarchical structures within a mesh node.
- For a results set created with
+, a row of an initial association described using
sourcedoes not need to exist in the internal table to ensure that this set is not empty. If
*is used, however, this row must exist.