Get Example source ABAP code based on a different SAP table
ABAP_ITAB - Virtual Sort of a Table This example demonstrates the virtual sorting of a single internal table.
ABAP_SOURCE_CODE DEMO CL_DEMO_VIRTUAL_SORT_SIMPLE
ABAP_DESCRIPTION An internal table filled with random numbers and letters is sorted virtually using the method VIRTUAL_SORT> of system class CL_ABAP_ITAB_UTILITIES>>, first in ascending order by the first two columns and then in descending alphabetical order by the last two columns. The returned array contains the line numbers in the respective sort order. This array is used to fill an internal table sorted_tab> according to the sorting. For comparison, an internal table test_tab> with the same content is constructed and sorted with the statement SORT> >. The results are the same in both cases.