SAP SORT ITAB SEC KEY ABEXA

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Sorting Internal Tables with Secondary Keys
This example demonstrates how tables with secondary table keys are sorted.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
The table itab has a secondary hash key for the column col2 . If the table is sorted in descending order using this column, the primary index is applied accordingly and a LOOP without a key produces the new order. If, however, USING KEY is used to specify the secondary hash key in the loop, the table is processed in the order in which it was filled.