Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing Internal Data →  Assignments →  Assigning Structure Components 

CORRESPONDING - Component Operator

Other versions: 7.31 | 7.40 | 7.54

Syntax Forms


Base Form

1. ... { CORRESPONDING dtype|#( [DEEP]
                               [BASE ( base )]
                               struct|{itab [ duplicates]} ) }
    | { CORRESPONDING dtype|#( [BASE ( base )]
                               struct|{itab [ duplicates]}
                               mapping ) } ...


Lookup Table

2. ... CORRESPONDING type( itab FROM lookup_tab
                               USING [KEY key_name] s1 = t1 s2 = t2 ...
                               [mapping] ) ...

Effect

A constructor expression with the component operator CORRESPONDING creates a result of a data type specified using type.

  • In the basic component, the components of a structured or tabular results are constructed from the components of a structured or tabular parameter struc or itab.
  • In the variant with lookup table, the components of an internal table itab and a lookup table lookup_tab are combined with a tabular result.

The following can be specified for type:

  • The # character as a symbol for the operand type. Can be specified only if the data type required in an operand position is unique and fully identifiable. The operand type must be a structure type or a table type. When a constructor expression is assigned to a field symbol or to a formal parameter with a generic table type, the operand type can only be determined at runtime.

The operator creates structures or internal tables with the specified data type. The components or columns of the result are filled using assignments of components of the parameters specified in the parentheses. The assignments are made using matching names or mapping relationships in a mapping rule.

Executable Examples

Assigning Components: Examples

Continue

CORRESPONDING - Base Form

CORRESPONDING - Lookup table

CORRESPONDING - mapping

CORRESPONDING - Duplicates