SAP CONSTRUCTOR EXPR CORRESPONDING



Get Example source ABAP code based on a different SAP table
  


VERSION 5 IN
• CORRESPONDING ABAP_CONSTRUCTOR
• # CORRESPONDING
• APPENDING CORRESPONDING

CORRESPONDING, Component Operator

ABAP_SYNTAX_FORMS

Basic Form
1 ... ${ CORRESPONDING ${dtype$|#$}( $[EXACT$] $[DEEP$]
struct$|${itab $[ duplicates$]$} ) $}
$| ${ CORRESPONDING ${dtype$|#$}( $[DEEP$]
$[$[APPENDING$] BASE ( base )$]
struct$|${itab $[ duplicates$]$} ) $}
$| ${ CORRESPONDING ${dtype$|#$}( $[$[APPENDING$] BASE ( base )$]
struct$|${itab $[ duplicates$]$}
mapping ) $} ...

Lookup Table
2 ... CORRESPONDING dtype( itab FROM lookup_tab
USING $[KEY key_name$] s1 = t1 s2 = t2 ...
$[ mapping$] ) ...

RAP-Specific Variants for Type Mapping
3 ... ${ CORRESPONDING ${dtype$|#$}( in_d_type MAPPING FROM ENTITY ) $}
$| ${ CORRESPONDING ${dtype$|#$}( ntype MAPPING TO ENTITY ) $}
$| ${ CORRESPONDING ${dtype$|#$}( in_d_type USING CONTROL ) $}
$| ${ CORRESPONDING ${dtype$|#$}( in_d_type MAPPING FROM ENTITY USING CONTROL ) $}
$| ${ CORRESPONDING ${dtype$|#$}( ntype CHANGING CONTROL ) $} ...

What does it do?
A constructor expression with the component operator CORRESPONDING creates a result of a data type specified using dtype.
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 to form a tabular result.
The RAP-specific variants are used for creating structures or internal tables with type mapping in ABAP in the context of RAP. RAP requires BDEF derived types for the communication of RAP BO providers and RAP BO consumers. When including non-BDEF-derived types (ntype), the variants are responsible for matching them to the input ( in_d_type) and output BDEF derived types.
The following can be specified for dtype:
A structured type or a table type.