on 2024 May 23 3:38 PM
Hi,
I have been doing some research on how to do this. I saw that this is very implement with managed query (via CDS views) using aggregate CDS annotations (only for oData v2 read-only apps).
https://help.sap.com/docs/abap-cloud/abap-rap/annotating-aggregate-functions-in-cds
However, it doesn't seem to be working when I do the same thing via an unmanaged query. I have also tried playing around with the UI.presentationvariant annotations but no luck, it is also working only for managed queries.
I have also tried implementing the logic from the link below in my unmanaged query provider class, but there seems to be a problem and is resulting to a dump.
https://help.sap.com/docs/abap-cloud/abap-rap/implementing-aggregations-in-unmanaged-query
The dump is caused by the incorrect select query.
SELECT (lv_req_elements) FROM /dmo/travel
WHERE (lv_sql_filter)
GROUP BY (lv_grouping)
ORDER BY (lv_sort_string)
INTO CORRESPONDING FIELDS OF TABLE @lt_travel_response
OFFSET @lv_offset UP TO @lv_max_rows ROWS.
The LV_REQ_ELEMENTS variable from io_request->get_requested_elements( ) only contains the BOOKING_FEE field.
The LV_GROUPING variable from io_request->get_aggregation( )->get_grouped_elements( ) is empty even though I specified the groupBy annotation in the PresentationVariant.
The LV_SORT_STRING variable from io_request->get_sort_elements( ) is also empty.
Does anybody know whether the @Aggregation.Default and presentationVariant is released for unmanaged query oData v2?
presentationVariant: [{
sortOrder: [{
by: 'Agency_ID',
direction: #ASC
}],
groupBy : [ 'Agency_ID' ],
totalBy : [ 'Agency_ID' ],
total : [ 'Booking_Fee' ],
visualizations: [{
type: #AS_LINEITEM
}]
}]@Andre_Fischer , just wondering if you have any thoughts on this? Thanks!
Request clarification before answering.
Hi rammel_sapdev,
It seems like person in this topic have somehow relevant issue as you, so it may indeed mean that they are not released. Have you considered to use Custom Logic in Query Provider?
If you need aggregation functionalities in your unmanaged query, you might need to implement the logic within your query provider class. This would involve building the aggregation logic manually within your code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 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.