SORT itab
Reference
Syntax
SORT itab [STABLE]
{ { [ASCENDING|DESCENDING]
[AS TEXT]
[BY {comp1 [ASCENDING|DESCENDING] [AS TEXT]}
{comp2 [ASCENDING|DESCENDING] [AS TEXT]}
... ] }
| { [BY (otab)] } }.
Effect
Sorts an internal table itab according to the table key or a specified sort key.
Additions
-
STABLE
Privides stable sorting, where the relative sequence of unrelated rows remaind the same.
-
ASCENDING
Sorts in ascending order.
-
DESCENDING
Sorts in descending order.
-
AS TEXT
Sorts text-type components according to the
locale of the current text environment.
-
BY comp1 ... comp2 ...
Sorts according to the specified
components comp1, comp2, ... instead of by table key.
-
BY (otab)
Sorts by the sequence specified in table OTAB of type ABAP_SORTORDER_TAB instead of by table key.