cancel
Showing results for 
Search instead for 
Did you mean: 

Query on PageSize Property in S/4 HANA Public edition -- Business Partner Odata API

rahuljain257
Participant
0 Kudos
269

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.

rahuljain257_0-1721810412209.png

Regards

Rahul Jain

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos
Are you using public cloud system? If yes, what app are you referring to?
rahuljain257
Participant
0 Kudos
@OwenLiu - I have modified the question, Yes its a S/4 Hana Public System. Beside that I am referring related to Odata API of Business Partner.
View Entire Topic
AndreasMuno
Product and Topic Expert
Product and Topic Expert

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.

AndreasMuno_0-1722275636639.png

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.