SAP LOOP AT ITAB KEY ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Loop with Key
The example demonstrates the execution of the statement LOOP AT itab with different table keys.

ABAP_SOURCE_CODE
DEMO CL_DEMO_LOOP_AT_ITAB_USING_KEY

ABAP_DESCRIPTION
The table spfli_tab is a hashed table with an unique primary key and two non-unique sorted secondary keys.
The first LOOP takes place without a key specification. The table output is in the order in which the table was filled, that is, sorted by the fields specified after ORDER BY in the SELECT statement.
The other two LOOP loops are performed with each of the secondary table keys city_from_to or city_to_from specified.