What does it do? Specifies a mesh path in statements and expressions> used to process meshes. A mesh path is always constructed as follows:
A root node rnode> specification
An initial mesh association _associ> specification between a root node and a follow-on node
Optional further mesh associations _assoc1>, _assoc2>, ... specifications whose start nodes can be the follow-on nodes of preceding mesh associations. When specifying a mesh path, it is not significant whether the address nodes of the mesh are internal tables or references to internal tables. When a mesh path is evaluated, references to internal tables are dereferenced automatically. A mesh path describes a set of lines in its final path node as its result>.
Latest notes: A mesh path cannot exit a mesh. Each follow-on node is part of the same mesh as the root node. Meshes can, however, be nested by specified a mesh path expression> as the source of the initial mesh association. NON_V5_HINTS ABAP_HINT_END
ABAP Addition
What does it do? Root node rnode> of a mesh path. rnode> is a node of a mesh type> that must be the start node or target node of a mesh association> of the mesh type. The same options are available when specifying the mesh as when addressing regular structure components:
mesh-rnode> mesh> is a mesh, that is, a data object of the respective mesh type>. The root node is addressed using the structure component selector (->).
< mesh>-rnode> < mesh>> is a field symbol typed with the mesh type and to which a mesh is assigned. The root node is addressed using the structure component selector (->).
mesh_ref->rnode> mesh_ref> is a reference variable whose static type is the mesh type and that points to a mesh. The root node is addressed using the object component selector (->>).
ABAP_EXAMPLE_VX5 Definition of a mesh type mesh> with internal tables and a mesh type refmesh> with references to internal tables as components. A data object mesh> has the type mesh> and a data object meshref> points to a data object of type refmesh>. The root node of the first mesh path is mesh-node1>. The structure component selector is used here. The root node of the second mesh path is node1> in the anonymous data object of type refmesh>, for which the object component selector is used. The references within the mesh are dereferenced implicitly. TYPES: BEGIN OF MESH mesh, node1 TYPE itab1 ASSOCIATION _assoc2 TO node2 ON ... node2 TYPE itab2, END OF MESH mesh, BEGIN OF MESH refmesh, node1 TYPE REF TO itab1 ASSOCIATION _assoc2 TO node2 ON ... node2 TYPE REF TO itab2, END OF MESH refmesh.
DATA(mesh) = VALUE mesh( ). DATA(meshref) = NEW refmesh( VALUE refmesh( ) ).
What does it do? Initial mesh association of a mesh path. Each mesh path has an initial mesh association specified after its root node. For _associ[ ... ] >, all mesh associations _assoc[ ... ] >> suitable for the root node can be specified, namely:
Forward associations> with a mesh association> of the mesh type that has the root node as the start node.
Inverse mesh associations> with a mesh association> of the mesh type that has the root node as the target node. The syntax used to specify the line of the entry node in the square brackets of the mesh association _assoc[ ... ]>> is [ source $[cond>$] ]> A structure source> of the line type of the root node must be specified as the source of the mesh association. This is a general expression position>. When the mesh path is evaluated, the content of source> is used as the starting point of the mesh association. Here, the evaluation of the ON> condition> of the mesh association used and any additional conditions cond>> produces a description of a set of lines of the follow-on node as a result>.
Latest notes: A structure specified as source> does not need to occur as a line in the root node. It is a good idea to use a table expression> that read a line from the root node. A mesh path expression > can, however, also be specified to nest meshes. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLE_VX5 Forward associations and an inverse mesh association as initial mesh associations of mesh paths. Table expressions that read a line from the root node are used as sources of the mesh associations. TYPES: BEGIN OF MESH mesh, node1 TYPE itab1 ASSOCIATION _assoc2 TO node2 ON ... node2 TYPE itab2, END OF MESH mesh.
What does it do? Path extension of a mesh path. Any number of further mesh associations can be chained after the initial mesh association. All mesh associations _assoc>> can be specified for _assoc1>, _assoc2>, ... that match the entry node in question, namely:
Forward associations> with a mesh association> of the mesh type that has the entry node as the start node.
Inverse mesh associations> with a mesh association> of the mesh type that has the entry node as the target node. The syntax used to specify the line of the start node in the square brackets of the mesh association _assoc[ ... ]>> is [ $[cond>$] ]> When the mesh path is evaluated, the result of the preceding mesh association, that is, the description of a set of lines in the entry node, is used as the starting point of the mesh association. Here, the evaluation of the ON> condition> of the mesh association used and any additional conditions cond>> produces a description of a set of lines of the follow-on node as a result>. If no further conditions are specified, the square brackets are empty.
ABAP_EXAMPLE_VX5 Path extension of the initial mesh association. The follow-on node of the initial mesh association is node2> and this node is the entry node of the path extension. The result of the entire mesh path is a description of lines in node3>. The result of the initial mesh association, whose starting point is defined by a table expression, is the implicit source of the path extension. TYPES: BEGIN OF MESH mesh, node1 TYPE itab1 ASSOCIATION _assoc2 TO node2 ON ... node2 TYPE itab2 ASSOCIATION _assoc3 TO node3 ON ... node3 TYPE itab3, END OF MESH mesh.