Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Object Services →  query service 

Sort Conditions

A sort condition is a list of attributes attr with the specification of the direction in which they should be sorted. You can only specify attributes with an elementary type. For each attribute, you have to specify whether it should be sorted in ascending or descending order, and this information is placed after the attribute. You can only use public attributes.

Other versions: 7.31 | 7.40 | 7.54

ASCENDING

attr ASCENDING

DESCENDING

attr DESCENDING


Note

The sort condition and its parameter list are analyzed when a query is executed and transformed into an internal display. To avoid parsing each time the query is executed, you can use the methods of interface IF_OS_QUERY_EXPR_FACTORY to create multiple-use sort conditions in the internal display.


Example

price ASCENDING date DESCENDING