[SAP CPI] – OPERATION BATCH IN ODATA V2 RECEIVER ADAPTER WITH CLOUD PLATFORM INTEGRATION

Hi guys, today I would like to share one article after long time busy with personal reason.

With ODATA V2 Receiver Adapter, we can read, create, update data of SAP backend.

For example, I will expose data from business object WBS element in public sector S/4 HANA Cloud

Scenario 01 – Get data

We can use syntax of ODATA to get data of particular entity.

Example: Get data of entity A_EnterpriseProject with Project is ZERO2HERO

We can use syntax of BATCH to get all data of multiple entities in one call to backend. This would greatly improve time taken to achieve such requirements, also improving the performance.

Example: Get all data of A_EnterpriseProject and A_EnterpriseProjectElement

Payload request

<batchParts>
    <batchQueryPart>
        <method>GET</method>
        <uri>A_EnterpriseProject</uri>
    </batchQueryPart>
    <batchQueryPart>
        <method>GET</method>
        <uri>A_EnterpriseProjectElement</uri>
    </batchQueryPart>
</batchParts>

Scenario 02 – POST DATA

We can configure method POST with ODATA Receiver Adapter. This is simple so I do not take demo.

In case we need to create Project and Project Element in one BATCH

Get structure BATCH for method POST

Mapping data into structure BATCH

Payload example for POST with BATCH between Project and Project Element

Configuration ODATA receiver adapter with BATCH

Result after run Test IFLOW with POSTMAN

Result in S/4 HANA

We can base on structure of BATCH to post multiple records in one call to backend.

Scenario 03 – POST and PUT in one BATCH

We can create and update data in one call to backend with BATCH

Structure below illustrate for this one

With this structure, we can create 2 entities for Projects and update 2 entities Project Element.

SUMMARY

In this article I shared way to send request ODATA to backend with BATCH operation. Instead call one by one to backend, we can use this way to improve performance.

Thanks for your time to read and any question or advise, kindly leave your comment on this.

Joseph.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.