SAP SORT TEXT ABEXA

Get Example source ABAP code based on a different SAP table
  


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.