SAP TABLE CMPRHNSNS JOIN ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Table Comprehensions, Join
This example demonstrates a join between internal tables using a table comprehension.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TABLE_COMPRH_JOIN

ABAP_DESCRIPTION
The lines of two internal tables itab1 and itab2 that have the same value in the column key are combined in a table. This example shows two options:
The table itab3 is created after a simple FOR expression for itab1 in which the associated values are read using table expressions from itab2.
The table itab4 is created after consecutive FOR expressions for itab1 and itab2. The last FOR expression is restricted by a WHERE condition.
In both cases, only those key values are evaluated in itab1. In the second case, duplicate key values in itab2 would also produce multiple lines in itab4.