SAP SORT TEXT ABEXA



Get Example source ABAP code based on a different SAP table
  



Sorting Internal Tables Alphabetically
This example demonstrates the alphabetical sorting of character strings.

ABAP_SOURCE_CODE
DEMO CL_DEMO_INT_TBLS_SORT_TEXT

ABAP_DESCRIPTION
The table itab contains a column of text fields and a column of associated country-specific sortable binary characters that were created in a sortable format using conversions. The table is sorted three times. First, binarily for the key field text, then binarily for the xtext field, and finally alphabetically for the key field text.
In the first sort Möller comes after Muller, because the internal representation of 'ö' comes after the representation for 'u'. Both the other sorts are alphabetical. The binary sort performed on xtext has the same result as an alphabetical sort on the field text.