Skip to Content
0
Former Member
May 17, 2010 at 05:06 PM

Sorting in descending order

1295 Views

Hi SDN,

F1 help on 'BINARY SEARCH' returns the following on the standard table usage:

Standard tables are subject to a linear search. If the addition BINARY SEARCH is specified, the search is binary instead of linear. This considerably reduces the runtime of the search for larger tables (from approximately 100 entries upwards). For the binary search, the table must be sorted by the specified search key in ascending order. Otherwise the search will not find the correct row.

I have to use a standard table because I need to sort the table in descending order. Is there a way to declare a descending key in itab definition?

Overall, what I need to know is the most effiecient way to use an internal table when it needs to be sorted in the descending order. I am accessing the table using a 'Read' statement.

Please advise.

Thanks.

SM