Skip to content

Copy fields with matching names

Copy fields with matching names from one data type to another with corresponding #( ).

target_structure = CORRESPONDING #( source_structure ).

Old style:

MOVE-CORRESPONDING source_structure TO target_structure.

Caution: The two statements differ in behavior. The CORRESPONDING( ) statement is a constructor statement, meaning all fields in the target_structure are initialized before the corresponding source_structure values are copied to the target_sructure The MOVE-CORRESPONDING statement in contrast leaves the content of the not matching fields in the target_structure untouched.

From SAP/styleguides under CC BY 3.0 — more details
Last updated on