Wir wachsen stetig und suchen neue Kollegen (m/w/d)! Schauen Sie sich unsere offenen Position an, um eine passende Herausforderung zu finden!
... ${ $}
$| ${INTO group$}$|${ASSIGNING group>$}$|${REFERENCE INTO group_ref$} ...
1. ... ${ $}
2. ... ${INTO group$}$|${ASSIGNING group>$}$|${REFERENCE INTO group_ref$}
Defines the output behavior of the group loop in a grouping of an internal table in a LOOP. The output behavior defines the following:
... ${ $}
Representative binding. If nothing is specified for the output behavior group_result, the output behavior is determined for the table lines using the addition result. In each loop pass, the first line of the current group is assigned as a representative of its group to the data object or field symbol defined there. The representative is bound to the current group and the group can be addressed using the name of the representative in the statement LOOP AT GROUP or the expression FOR ... IN GROUP.
If the representative binding is used,
Outside of the group loop, the representative is not bound to the group and cannot be used to specify it in member loops. This applies in particular to procedures called from the group loop.
If a representative is bound to the current group, the associated group key cannot be addressed in the group loop.
The group key in the following example is a structure with two components key1 and key2
to which the columns key1 and key2 are assigned to each line of the internal table itab
in the grouping. This produces three groups with the group key values
(a, a), (a, b), and
(b, a). Accordingly, the group loop is passed three times and the first, second, and sixth line are assigned to the field symbol wa> as representatives. See also the
executable example of output behavior.
... ${INTO group$}$|${ASSIGNINGgroup>$}$|${REFERENCE INTO group_ref$}
Group key binding. If an explicit output behavior group_result is specified, the group key of the current key is assigned to the data object or field symbol specified after INTO, ASSIGNING, or REFERENCE INTO in every loop pass. Here, the same syntax and semantics apply as in the output behavior result. The data type of the specified data object or field symbol must match the data type of the group key. If the group key is constructed as a new structure in the group key expression, the target type must be a structure whose components have the same name and in the same order as in the group key.
The specified data object or field symbol is bound to the current group and the group can be addressed using its name in the statement LOOP AT GROUP or the expression FOR ... IN GROUP. Outside of the group loop, the data object or field symbol is not bound to the group and cannot be used to specify it in member loops. This applies in particular to procedures that are called from the group loop. At the end of the group loop, the grouping is canceled and a specified data object is initialized or a field symbol no longer has a group key assigned to it.
The data object or field symbol of the output behavior defined in result for the table lines can still be addressed in the group loop but it is either initial after the LOOP statement or does not point to a line.
Like in the previous example, however the groups are not assigned to an implicit representative here
and to the explicitly defined target area for the group key instead. In each of the three loop passes,
the reference variable group_key declared inline points to the respective structured group key
(a, a), (a, b), and (b, a). See also the
executable example of output behavior.
Wir bieten ganzheitliche SAP-Lösungen aus einer Hand, um den digitalen Wandel zu gestalten und neue Geschäftsfelder zu erschließen.
Schweiz
Schaffhausen
Deutschland
Mannheim, Düsseldorf, München
USA
Haverhill
Griechenland
Thessaloniki