SAP Knowledge Base Article - Public

2726463 - Fields Not Sorted Using $OrderBy in OData Reports


You have built an OData query to retrieve report data, and you have used the operand OrderBy to sort the fields, however in the report results you can see that the data is not sorted.

For example: You are calling the report Invoice Volume via the following URL:$select=CIPR_PROD_UUID,CIACBA_PRJ_UUID&$orderby=CDOC_UUID desc

And you would expect that the results are sorted by Invoice ID, in a descending order, however this is not the case.


SAP Business ByDesign

SAP Hybris Cloud for Customer


For the OrderBy option to work, you have to add the field on which you are sorting to the view (via $select) and it has to be the first field in the list.


In this example, you would need to change the URL to:$select=CDOC_UUID,CIPR_PROD_UUID,CIACBA_PRJ_UUID&$orderby=CDOC_UUID desc

See Also

1628310 - Sorting of Characteristics and Key Figures in Reports


Odata, report, orderby, sorting, characteristic, ascending, descending , KBA , AP-RC-ANA , C4C, ByD, Travel: Analytics Tools & Frameworks , Problem


SAP Business ByDesign all versions ; SAP Cloud for Customer core applications all versions