ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Assignments → Assigning Structure Components
MOVE-CORRESPONDING
Other versions: 7.31 | 7.40 | 7.54
Syntax Forms
Variant for Structures
1. MOVE-CORRESPONDING [EXACT] struc1 TO struc2
[EXPANDING NESTED TABLES].
Variant for Internal Tables
2. MOVE-CORRESPONDING [EXACT] itab1 TO itab2
[EXPANDING NESTED TABLES] [KEEPING TARGET LINES].
Effect
The statement MOVE-CORRESPONDING
is used to assign components with the same
name in structured data objects to each other. There are two variants of the statements, which can call each other internally:
- Both operands are structures.
-
Both operands are internal tables.
No other combinations of operand types are possible. Field symbols typed with the generic type
ANY or formal parameters can also be used as operands. An operand of this type must be either
a structure or an internal table when the statement is executed and match the other operands; if not, an unhandleable exception is raised. struc1
and itab1
are
functional operand positions.
Notes
-
If mapping based on identical names is not sufficient for the statement
MOVE-CORRESPONDING
, the component operatorCORRESPONDING
can be used, which makes it possible to define separate mapping rules statically. - If dynamic mapping rules are needed, the system class CL_ABAP_CORRESPONDING can be used.
-
If an internal table with a header
line is specified for one of the operands, the header line is used as an operand in accordance with its data type, not the table body.
Non-Handleable Exceptions
-
Cause: The operands are not both structures or internal tables.
Runtime error:TCHK_MOVE_CORRESPONDING
: -
The same runtime errors can occur as for
MOVE
andMOVE EXACT
. -
The same runtime errors can occur as for
INSERT itab
.