ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Meshes → Meshes - Mesh Paths → Meshes - mesh_path → Meshes - _assoc[ ... ]
Meshes - [ ... cond ]
Other versions:
7.31 | 7.40 | 7.54
Syntax Forms
... { col1 = val1 col2 = val2 ... }
| { [USING KEY key] [WHERE log_exp] } ...
Variants
1. ... col1 = val1 col2 = val2 ...
2. ... [USING KEY key] [WHERE log_exp]
Effect
Specifies an additional condition in the square brackets, [ ... ], of a mesh association in a
mesh path. In an initial mesh association, a condition
of this type can be specified alongside the structure source. In the case of a path extension, the square brackets contain an additional condition or are empty.
Variant 1
... col1 = val1 col2 = val2 ...
Effect
Additional condition when using mesh paths in mesh
path expressions. col1, col2, ... can be used
to specify columns of the follow-on node of the mesh association that do not already occur in their
ON condition. Each
of these columns is assigned a value val1, val2,
... Their content must match this value to meet the condition. val1, val2, ... are
general expression
positions. The additional condition is joined with the
ON condition to create a full condition. In the case of an initial mesh
association, the comparison values of the ON condition are specified explicitly
as a structure source; in the case of a path extension, the comparison values are taken from the results set of the preceding mesh association.
Executable Example
Variant 2
... [USING KEY key] [WHERE log_exp]
Effect
Additional condition when using mesh paths in the statements and expressions:
Only one WHERE condition, USING KEY with a
WHERE condition, or USING KEY alone can be specified. USING
KEY must be specified before a WHERE condition. The syntax and semantics
of the WHERE condition are the same as when
WHERE log_exp is specified statically for the statement
LOOP AT itab, but the comparison is made for columns of the follow-on node.
USING KEY can be used to specify a
table key key of the follow-on node. The name or alias name of the table key must be specified directly.
- If only one
WHEREcondition is specified, any comparisons for columns of the follow-on node are possible in this condition. These columns can be specified already in theONcondition of the mesh association. TheWHEREcondition works like an additional condition joined with the evaluation of theONcondition usingAND.
- If specified,
USING KEYdefines the table key used to access the follow-on node. It overrides any otherUSING KEYs specified in definition of the mesh association.
- If
USING KEYis specified in front of aWHEREcondition, the equality comparisons of theWHEREcondition joined using AND are joined with theONcondition as a single condition, also usingAND. Optimized key access must be possible here: There can be no duplicate columns in the joined condition and, in the case of a sorted table key, it must cover a left initial part. In the case of a hash key, it must cover all key fields of the follow-on node. Further parts of theWHEREcondition, such as comparisons joined usingORor comparisons for properties other than equality, are not required for optimized key access and work in the same way as whenWHEREis specified as an additional condition.
- If
USING KEYis specified without aWHEREcondition, theONcondition of the mesh association must meet the prerequisites for optimized access for the table key.
Note
USING KEY can be specified without a WHERE, for example, to use a table key with a different order of key fields as in a table key specified in a mesh association.
Examples
See the examples of the statements discussed here.