ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Assignments → Assigning Structure Components → CORRESPONDING - Component Operator
CORRESPONDING - Duplicates
Other versions:
7.31 | 7.40 | 7.54
Syntax
... DISCARDING DUPLICATES ...
Effect
Addition for handling duplicate rows in the component operator
CORRESPONDING
. The addition DISCARDING DUPLICATES
can be specified:
- After a tabular parameter
itab
in the basic form.
- After mapping relationships
t1 = s1
,t2 = s2
, ... for tabular components.
The addition DISCARDING DUPLICATES
prevents an exception when duplicate entries occur with respect to a unique
primary or secondary
table key in assignments to a target table. In the basic form, this also applies to the rows in an internal
table specified after BASE
.
By default, the addition DISCARDING DUPLICATES
acts on the source table that it is specified after. That is, either to
itab
of the basic form or tos1
, s2
,
... of mapping relationships. If DISCARDING DUPLICATES
is specified with
the addition DEEP
after itab
in its basic form, it is also applied to the statements of nested internal tables.
The addition DISCARDING DUPLICATES
dictates that, when rows of a source table
are inserted sequentially into a target table, the rows that are already in the target table with the same unique primary or secondary table key are ignored in the source table and do not raise an exception.
If the addition DISCARDING DUPLICATES
is specified for an operand for which a unique table key is not known statically, the syntax check produces a warning.
Example
Uses DISCARDING DUPLICATES
in the executable example.
MAPPING y1 = x1
y2 = x2 DISCARDING DUPLICATES ) ...