Skip to content

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 an association in a mesh path. In an initial 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 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 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 association.


Example

See Mesh Path Expressions.

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 WHERE condition is specified, any comparisons for columns of the follow-on node are possible in this condition. These columns can be specified already in the ON condition. The WHERE condition works like an additional condition joined with the evaluation of the ON condition using AND.
  • If specified, USING KEY defines the table key used to access the follow-on node. It overrides any other USING KEYs specified in definition of the association.
  • If USING KEY is specified in front of a WHERE condition, the equality comparisons of the WHERE condition joined using AND are joined with the ON condition as a single condition, also using AND. 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 the WHERE condition, such as comparisons joined using OR or comparisons for properties other than equality, are not required for optimized key access and work in the same way as when WHERE is specified as an additional condition.
  • If USING KEY is specified without a WHERE condition, the ON condition of the association must meet the prerequisites for optimized access for this 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 an association.

Examples

See the examples of the statements discussed here.