SAP CORRESPONDING USING SELF ABEXA



Get Example source ABAP code based on a different SAP table
  



Component Operator, Reflexive Assignment
This example demonstrates the component operator with FROM USING for a single table.

ABAP_SOURCE_CODE
DEMO CL_DEMO_CRRSPNDNG_USING_SELF

ABAP_DESCRIPTION
Using the component operator CORRESPONDING in the variant with lookup table, the example relates an internal table itab in a component expression to itself and assigns the result to the same table. This requires a temporary copy of the table to be created, which raises a warning from the syntax check. This warning can be hidden using the pragma ##operator.
The table contains a hierarchical tree structure in which nodes of the column node are assigned to a parent node using the column parent. This relationship is specified after USING, which finds the parent node for every line. The assignment of the identically named component text ensures that every line in this column is given the content of its direct parent node.
For further examples of reflexive assignments, see the executable example Reflexive Component Assignments.