SAP LOOP AT ITAB KEY ABEXA

Get Example source ABAP code based on a different SAP table
  


ARTIClE

Internal Tables, Loop with Key Specified
The example demonstrates the execution of the LOOP AT itab statement with various table keys.

ABAP_SOURCE_CODE
ABAP_EXEC

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 being specified. The table output is in the order in which the table was filled. This means it is sorted by the fields entered after the ORDER BY of the SELECT statement.
The other two LOOP loops are carried out under the specification of one of the two secondary table keys city_from_to or city_to_from.
The columns whose sort order were used to output the table are indicated by color.