Sorting Internal Tables in ABAP - Stable sort
Details
- Details
- Category: ABAP
- Created on Thursday, 15 November 2012 08:37
- Last Updated on Thursday, 15 November 2012 08:43
- Published on Thursday, 15 November 2012 08:37
- Written by Administrator
- Hits: 34579
Page 4 of 5
Stable Sort
The option
SORT <itab> ... STABLE.
allows you to perform a stable sort, that is, the relative sequence of lines that are unchanged by the sort is not changed. If you do not use the STABLE option, the sort sequence is not preserved. If you sort a table several times by the same key, the sequence of the table entries will change in each sort. However, a stable sort takes longer than an unstable sort.