ARTIClE
Sorting Internal Tables Alphabetically
This example demonstrates the alphabetical sorting of character strings.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
The table itab contains a column with text fields and a column
with corresponding, country-specific, binary characters that can be
sorted and have been created, through conversion, in a sortable
format. The table is sorted three times. First, a binary search on the
key field text , then a binary search on the xtext field
and finally, alphabetically on 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 alphabetic. The binary sort on xtext has the
same result as an alphabetic sort on the field text .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved