on ‎2019 Nov 29 11:12 AM
Hello,
How to implement orderby in Code based OData? I try CDS based OData expose as RDS in SEGW and create the UI using Fiori Elements List Report. Then I redefine the GET_ENTITYSET in DPC_EXT class and I do not call the super class.
Here is how I currently implement the orderby
SELECT ....
INTO TABLE @DATA(lit_data)
....
" order by
CALL METHOD /iwbep/cl_mgw_data_util=>orderby
EXPORTING
it_order = it_order
CHANGING
ct_data = lit_data.
....
implement paging & stuff
I can debug and show that the internal table it is actually sorted correctly. But somehow, in the List Report application, the record is not shown as in the same order as in the internal table.
How to implement order by correctly?
Thank you.
Request clarification before answering.
Hi,
I solve this by specifying the correct keys in the CDS. So, in the report result there are actually 2 fields that make each record unique, but in the CDS I only specify 1 of those 2 field as the key. I set 2 fields as keys correctly and now the sorting works.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.