SAP CORRESPONDING ITAB ABEXA



Get Example source ABAP code based on a different SAP table
  



Component Operator for Internal Tables
This example demonstrates the component operator for internal tables.

ABAP_SOURCE_CODE
DEMO CL_DEMO_CRRSPNDNG_ITAB

ABAP_DESCRIPTION
This example uses the same internal tables as the executable example for MOVE-CORRESPONDING. Here, the source table itab1 is used as a parameter of a constructor expression with the component operator CORRESPONDING and the result is assigned to the target table itab2. The source table itab1 is assigned to the result with the type of itab2 with and without the addition DEEP . If the addition BASE is used, the result is given the original value of itab2 as the start value and otherwise stays initial. The assignment is made exactly as described in the executable example for MOVE-CORRESPONDING with or without EXPANDING NESTED TABLES. The use of the component selector with the addition BASE has the same effect as using MOVE-CORRESPONDING with the addition KEEPING TARGET LINES. If DEEP is used the name comparison is made for the components of the substructure col3, which means that fewer assignments are made than when omitting DEEP.
The uninvolved component col4 keeps its initial value in the new lines in both examples. The result is assigned to the target table itab2. Unlike in the executable example for structures, the final results for MOVE-CORRESPONDING and the component selector CORRESPONDING are the same, since assignments are made to initial new lines in both cases.