Purpose of the Article: This Blog provides a solution to use SAP OData Services by using the S/4 HANA Connector to integrate SAP system via Mulesoft
Intended Audience: MuleSoft Developers
Tools and Technology: MuleSoft, Anypoint Studio, SAP S/4 HANA Connector
Keywords: SAP S/4 HANA Connector, SAP OData Service in Mulesoft, Batch Execute Function in Mulesoft, Batch in SAP system with Mulesoft, batchId, Execute Batch, OData in Mulesoft
SAP S/4HANA OData Connector
Mulesoft provides the SAP S/4 OData Connector to integrate the OData services of the SAP system. SAP OData API services expose SAP S/4HANA Cloud and SAP S/4HANA on-premises.
- 1. Batch create entity
- 2. Batch update entity
- 3. Batch get entity
- 4. Batch delete entity
- 5. Batch query entity
- 6. Create change set
- 7. Batch execute function
- 8. Create entity
- 9. Delete Entity
- 10.Execute Batch
- 11. Execute function
- 12. Get entity by key
- 13. Initiate Batch
- 14. Query
- 15. Unauthorized
- 16. Update entity
SAP S/4HANA OData Connector can be downloaded from Anypoint exchange through Anypoint studio using the “Search in Exchange” option in Mule Palette.
Connector configuration
Here Connector configuration is provided with mandatory values of Connection, Username, Password, and Service URL (https://<host>:<port>/).
Batch executes function operation can be performed using a sequence of below operations:
- Initiate Batch
- Batch execute function
- Execute Batch
Having the Batch ID from SAP is mandatory to perform any batch operation. Here Initiate batch operation is used to get the batch id and store it in the target variable so that it is used for batch operations.
Similarly, the Create Change Set operation generates a new change set Id. This id performs Batch Create, Batch Update, Delete Entity, or Batch Execute Function operations.
The Connector throws an exception if you try to read the result before the Execute Batch operation. To get the output after Execute Batch operation, the result should be stored in the variable and accessed after the execution.
Execute Batch operation returns the summary containing detailed information about the batch operation.
Below is the request payload, which can be used to execute the Batch execute function.
Finally, we can capture the payload by placing the set payload component.
Author Bio:
Sai Santhosh Jana
Team Lead - Enterprise Integration
I am a MuleSoft Developer and have about 5+ years of work experience. In MOURI Tech, I have been involved in multiple projects where I have worked with multiple connectors and been involved in a couple of research activities to find the solution in project deliverables