What does it do? 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.
ABAP_VARIANT_1 ... col1 = val1 col2 = val2 ...>
What does it do? 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 result set of the preceding mesh association.
What does it do? Additional condition when using mesh paths in the statements and expressions:
LOOP AT mesh_path ...>>
FOR ... IN mesh_path ...>>
INSERT ... INTO TABLE mesh_path ...>>
MODIFY mesh_path.>>
DELETE mesh_path.>>
SET ASSOCIATION mesh_path ...>> Only one WHERE> condition, USING KEY> with a WHERE> condition, or only USING KEY> can be specified. USING KEY> must be specified in front of 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 also already be specified in the ON> condition> of the mesh association. The WHERE> condition works like an additional condition joined with the evaluation of the ON> condition using AND>.
The specification USING KEY> defines the table key used to access the follow-on node. It overrides any other USING KEY> specifications in the definition> of the mesh association.
If USING KEY> is specified in front of a WHERE> condition, the equality comparisons of the WHERE> condition joined using AND> are also joined using AND> with the ON> condition> to form a condition. 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 only specifying a WHERE> condition as an additional condition.
If USING KEY> is specified without a WHERE> condition, the ON> condition> of the mesh association must meet the prerequisites for optimized access for the table key.
Latest notes: USING KEY> can be specified without a WHERE> condition, for example, to use a table key with a different order of key fields as in a table key specified in a mesh association. NON_V5_HINTS ABAP_HINT_END
ABAP_EXAMPLES See the examples of the statements> discussed here. ABAP_EXAMPLE_END