Skip to content

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

Meshes - mesh_path

Other versions: 7.31 | 7.40 | 7.54

Syntax


... {mesh-|<mesh>-|mesh_ref->}rnode
_associ[ ...
 ]
_assoc1[ ... ]_assoc2[ ... ] ... 

Extras

1. ... {mesh-|<mesh>-|mesh_ref->}rnode

2. ... _associ[ source [cond] ]

3. ... _assoc1[ [cond] ]_assoc2[ [cond] ] ...

Effect

Specifies a mesh path in statements and expressions used to process meshes. A mesh path is always constructed as follows:

  • A root node rnode
  • An initial mesh association \_associ between a root node and a follow-on node
  • Optional further mesh associations \_assoc1, \_assoc2, ... whose starting nodes can be the follow-on nodes of preceding mesh associations.

When a mesh path is specified, 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 rows in its final path node as its result.


Note

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.

Addition 1

... {mesh-|<mesh>-|mesh_ref->}rnode

Effect

Root node rnode of a mesh path. rnode is a node of a mesh type that must be the source 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 mesh type in question. 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 which points to a mesh. The root node is addressed using the object component selector (->).


Example

Defines 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. The object component selector is used here. 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( ) ).

... mesh-node1\_assoc2[ ... ] ...
... meshref->node1\_assoc2[ ... ] ...

Addition 2

... _associ[ source [cond] ]

Effect

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, therefore,

The syntax used to specify the row of the source node in the square brackets of the mesh association _assoc[ ... ] is

[ source [cond] ]

A structure source of the row 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 ON condition is used to produce a description of a set of rows of the follow-on node as a result from the mesh association and any additional conditions cond.


Note

A structure specified as source does not need to occur as a row in the root node. It is a good idea to use a table expression that read a row from the root node. A mesh path expression can, however, also be specified to nest meshes.


Example

Forward associations and an inverse mesh association as initial mesh associations of mesh paths. Table expressions that read a row 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.

DATA(mesh) = VALUE mesh( ... ).

... mesh-node1\_assoc2[ mesh-node1[ ... ] ] .
... mesh-node1\_assoc2~node2[ mesh-node1[ ... ] ] .
... mesh-node2\^_assoc2~node1[ mesh-node2[ ... ] ].

Addition 3

... _assoc1[ [cond] ]_assoc2[ [cond] ] ...

Effect

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 starting node in question, namely:

The syntax used to specify the row of the source 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 (the description of a set of rows in the source node) is used as the starting point of the mesh association. Here, the ON condition of the mesh association in question and any additional conditions cond are used to produce a description of a set of rows of the follow-on node as a result. If no further conditions are specified, the square brackets are empty.


Example

Path extension of the initial mesh association. The follow-on node of the initial mesh association is node2 and this node is the starting node of the path extension. The result of the full mesh path is a description of row 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.

DATA(mesh) = VALUE mesh( ).

... mesh-node1\_assoc2[ mesh-node1[ ... ] ]\_assoc3[  ] ...

Continue

Meshes - _assoc[ ... ]