on 2016 Feb 05 10:50 AM
Hi Experts,
I don;t understand how can I maintain the sort order of CDS view? For example I want to create cds view of table SPFLI and sort it by connnid. How can I do this. I use statement
DEFINE VIEW Z_spfli_view AS SELECT FROM spfli {
connid as number,
}
And after that I can;t use ORDER BY. So how can I sort the result list? Maybe some annotations can be used?
Best Regards,
Mikhail
Hello,
for a HANA CDS View you can use "order by". For an ABAP CDS View no "order by" is possible. You have to to the sort when you consume the view in e.g. an Open SQL Statement.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, so, I have no possibility to sort it without starting ABAP Report? I just want to create smart template fiori application. For this I created a CDS view, then generated ODATA service. Is it possible maybe to create some 'consumption' view and use some analytical annotations? I need to sort it without coding. Or it is absolutely impossible?
There exists no annoation to define a kind of "default sort" (UI Annotations - Reference - SAP Library). On the backend side it would also make no sense to define a hard sort criterion because from the client side different sort criteria may be used (specific to the requirements).
On the client side you could add a default sort criterion during start up which is then applied as filter to the binding of the OData service.
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.