Symptom
Consider the example of a business use case where every time a record is created in the custom API service, a request is sent to the standard Business Partner API which is API_Business_Partner. During the process, the Business Partner API is running to a timeout error. This works fine for smaller number of entries (for example 10 entries) but for larger number of entries, the system throws a Time Out error.
500 Connection Timed Out
Timeout occurred
Error code: ICMETIMEOUT
Environment
SAP S/4HANA Cloud
Reproducing the Issue
- Login to the system
- Go to the custom Fiori app
- Browse and Upload the template
- System processes the file for around 10 minutes but later throws a Time Out error
The same behaviour is observed in the SAP Cloud Platform Integration (CPI) tool.
Cause
A single $batch request containing several single requests would lead to a long runtime on most services. Also, as long as API_BUSINESS_PARTNER is called via single requests, the processing of a single business partner will most likely never take below one second. Therefore several separate requests would be leading to the timeout error.
With service API_BUSINESS_PARTNER it is currently not possible to perform operations on multiple Business Partners in a single change-set request. You may refer the documentation available for Business Partner (A2X).
Resolution
- For single requests or separate changesets to API_BUSINESS_PARTNER we recommend no more than 100 requests at a time.
- You have to split the .csv-file into smaller files so that the custom app triggers smaller $batch requests.
- We would not recommend to call an asynchronous SOAP-request within the implementation of your synchronous OData request even if it was somehow possible.
The workaround is to automatically split up large .csv-files into separate $batch-requests containing 100 operations each in the custom Fiori app. In your custom Fiori app, change the batchGroupId with which the request is triggered after every 100 requests.
See Also
Keywords
Timeout occurred, ICMETIMEOUT, 500 Connection Timed Out, $batch, API_BUSINESS_PARTNER, Time Out , KBA , LO-MD-BP-ODT , OData Service for Business Partner , Problem