Get the total_count and the data in one request #5646
dboeck
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Apparently, the SAP CLOUD SDK does not offer a direct way to return the count (total_count) of an entity requested from sap and the actual data in a single request, even though the SAP API actually allows this with the parameter $count=true. There seems to be only the option to fetch the count in a separate request (https://sap.github.io/cloud-sdk/docs/js/v3/features/odata/common/operations/count), which would mean we would have to send each request for a table twice... which, of course, would be very slow.
For this reason, when we need the total_count of the entity in the requests, we have to "work around" the SAP CLOUD SDK and send the query as a raw request, including a custom query parameter. If there is a different way to get the total_count and the data in one request with the typescript SAP CLOUD SDK i'm happy to here from you :-)
Here’s the code example:
Beta Was this translation helpful? Give feedback.
All reactions