on 2021 Aug 17 5:40 AM
I am trying to display data in fiori elements application through custom entity CDS.
By default it was taking page size of 25 & was not showing records after that even after scrolling & page down button.
Inside the implementation of IF_RAP_QUERY_PROVIDER~SELECT method I had retrieved the paging object using IO_REQUEST->GET_PAGING method.
Then I tried downcasting it & then change the dynamic public attribute MV_HAS_PAGING from X to SPACE(INITIAL).
I was able to do the same manually through changing the attribute value in debugger, but when I am trying to do the same in code it's giving me dump of changing protected field as it's reference is coming as read-only.
Code Snippet-
method : IF_RAP_QUERY_PROVIDER~SELECT.
data(lv_page) = io_request->get_paging( ).
data: lo_ref type ref to object.
lo_ref ?= lv_page.
ASSIGN lo_ref->('MV_HAS_PAGING') to FIELD-SYMBOL(<lfs_attr>).
<lfs_attr> = abap_false.
Request clarification before answering.
Hi ak4522912!
Did you find a solution? I'm facing same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
the IF_RAP_QUERY_REQUEST, PAGING and any other API object must not be changed!
The consumer is sending a certain request and your implementation has two options: You are either able to process the request and send a response accordingly or you can raise an exception as declared in IF_RAP_QUERY_PROVIDER~SELECT to state that you were not able to handle the request according to the OData and unmanaged query contract. Changing attributes or replacing the objects will lead to runtime errors as the orchestration framework makes sure that those stay untouched and data is returned accordingly.
If you want to select more or less data please configure your application consuming data from your unmanaged query accordingly. OData offers a variety of query options to request the data as needed. $top and $skip can be used to select data in packages and those will be reflected in the paging.
Best regards,
Dominik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dominic,
Thanks for your response. I agree that API objects shouldn't be changed. I only tried to do this as the last resort. When I created my fiori list(elements) app by using the binding of my custom entity as a data source, I was unable to change the paging option from front end by doing changes in maifest.json file.
I tried using adaption project also to change paging option but it didn't work. Paging option was still enabled and page size was coming as 25 so only top 25 records were displayed. Rest of the records were not displayed even after scrolling or pressing page down button.
During debugging I disabled paging(attribute MV_HAS_PAGING inside IF_RAP_QUERY_PROVIDER~SELECT) manually & it worked( all records were displayed) but wasn't able to do that via ABAP code.
As my front end is based on fiori elements, I think it will not be possible to use Odata query with $top & $skip.
Please suggest if there is any other way or workaround to show all data ( ~20k records) in my fiori application via custom entity.
Regards,
Amit Kumar
Hi Amit,
it is in the responsibility of the consumer/client to request data as they need it. Your backend implementation should not alter a request and only provide what has been requested.
Fiori Elements Apps in the end also just generate OData requests. Smart Template Applications do that correctly and if you have implemented a custom fiori app, than it might be that you have to do some frontend coding. Maybe this is helpful for you: https://blogs.sap.com/2014/11/19/sapui5-pagination-in-sapmtable-using-skip-and-top-values-of-odata-s...
Regards,
Dominik
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.