2024 Jul 22 11:35 AM - edited 2024 Jul 24 9:40 AM
Dear All,
Good Day to Everyone
Is there a PageSize property available in S/4 HANA Public edition -- Business Partner Odata API ? Setting this property should return all the specified records from the system.
Regards
Rahul Jain
Thank you for your question, @rahuljain257.
You may want to try out the API with its many segments in the SAP Business Accelerator Hub (SAP Business Accelerator Hub). For example with segment A_BusinessPartner. First try with the $top set to 50 as is the default.
Press 'Run'.
Take note of the Request URL in the response. I got "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$to...".
In the response body note field
"__count": "7057"
This is the number of all records for that segment. That number helps you build expectations if and when you decide to adjust the number of records in $top. You can use parameter $top like a paginator, and even leave it out, but only up to a point. For illustration, try again with the 50 removed. The API might not execute: "Error! Execution failed please try again".
Now try with a different segment, say, the first one in the list on the left, A_AddressEmailAddress. Remove the '50' in $top, but keep $inlinecount with value "allpages", that ensures you get the __count in the results.
If you need all the records to a particular segment, you may first want to get an understanding of the response behavior of the API for that segment. Just try with $top = 1 and $inlinecount = "allpages". Then go with approximation for the number of records you get returned - if any - when leaving $top blank:
For example, for A_BusinessPartner and $top I entered ever lower 4 digit numbers starting with 7000, decrementing by 1000 until I got to a number that yielded results again, '1000'. Then I increased the number again, here to 1500 (OK) then 1900 (Error), 1600 (Error). The cut-off number for this segment must be between 1500 and 1600. I also noticed, getting 1500 records cost me about 5 seconds (against a performance-limited sandbox system, please test for your customer system, too).
For the values of all records of a segment you may then want to use "pagination" deliberately with stability/reliability and performance criteria in mind. You'd hop from page to page by setting respective parameter $skip, accordingly, e.g. at 1500, with $top 1500 (or lower, and respectively more pages, but better per-page performance).
Enjoy 'playing' with the different segments.
If this solves your request, please mark accordingly. Thank you, Rahul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.