As a member of Customer Success Team, we are responsible for enabling/support customers and internal stakeholders to achieve their integration scenarios using SAP Cloud Platform Integration tool.

During the support, we encounter some tricky scenarios, which are not very specific to their use case but can be common to all.

This blog is an answer to one of such tricky question i.e.

How can I make OData Batch Request with multiple operations on multiple entity sets.

Customer need this capability majorly for the following use cases:

Customer wants to pack several functionally related API requests and send them to the web API service in one HTTP request and receive a single HTTP response with the response to all their requests. For example: Update in one entity set, also requires an upate in another functionally related entity set.

Customer want to pack several API requests and send them to the web API service in one HTTP request and receive a single HTTP response by creating their own OData service on CPI platform. This new OData service then call existing OData service with mutiple operations on multiple entity sets using single batch request.This way, the client can optimize calls to the server and improve the scalability of its service.

Then call the OData endpoint using OData Adapter using Request-Reply flow step.

Important Note: The OData Adapter can be configured with any batch operation. In design time selecting a particular entity set and batch operation doesn’t matter as the call will happen based on the previous cumulative batch request payload.

Finally the OData batch request response is captured as an XML file in SFTP Server

This way we can make a single batch request with multiple operations on multiple entity sets.

With the learnings of this blog, I recommend you to try this capability in OData Provisoning (ODP) i.e. create a new OData service from existing OData service and internally make a batch request with muiltiple operations on multiple entity sets.

3 Comments

Thanks for your time preparing this blog. It’s very nice and made clear some doubts that I’ve been looking for.

I have a demand to build an iflow to add and update dependents on SFSF. In order to achieve it, it’s necessary to call 5 entities: PerPerson, PerRelationship, PerPersonal, PerNationalId and PerGlobalInfoBRA.

I have created the iflow (below screenshot), it’s working fine, but I would like to know what is the better way to control the rollback in case some of these entities fails.

If you are asking this question in context of OData batch request, then in a single batch request you can have multipe ChangeSets. A single ChangeSet can contain multiple operation on multiple entity sets.

All operations in a ChangeSet represent a single change unit so the server must successfully process and apply all the requests in the ChangeSet or else apply none of the requests in the ChangeSet. It is up to the service to define rollback semantics to undo any requests within a ChangeSet that may have been applied before another request in that same ChangeSet failed and thereby honor this all-or-nothing requirement.

So in your case you can put all related operation in single ChangeSet, so that if anything goes wrong with any of the opertaion, none of the requests in the ChangeSet should apply.

We have a critical point for these entities: all of them accept only UPSERT and QUERY operations. Following SFSF API, CREATE and UPDATE are not allowed for them and up to my knowledge, OData batch request does not accept USPSERT, right? I’ve done a test right now and Odata batch response confirmed it.

When setting the SuccessFactors Adapter for UPSERT these entities, there is an option to flag “Enable batch processing”. I’ve also tried it, but the XSD is the same generated when choosing OData Adapter and it also didn’t work.