SAP TABLE CMPRHNSNS SIMPLE ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Table Comprehensions, Basic Properties
This example demonstrates the basic properties of table comprehensions.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TABLE_COMPRH_ELMNTRY

ABAP_DESCRIPTION
From an internal table itab1, the content of new internal tables is created in constructor expressions with one FOR expression each:
itab2 has the same line type as itab1. All columns of all lines are assigned that meet a WHERE condition.
itab3 has the same line type as itab1. All lines are assigned that meet a WHERE condition from a line.
itab4 has fewer columns than itab1. Only certain columns of a restricted number of lines are assigned.
itab5 has only one column. The addition BASE is used to first assign the table base and then the first column of itab1. This demonstrates the effect of specifying a sorted secondary key for this column.