---
schema_version: "1"
id: 232e5517400013590a0e7897638e5dec6035331f6f72a90d062d08bcda3f1d0c
title: SAP S/4HANA OData Connector 2.9 Batch Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/sap-s4hana-cloud-connector/latest/sap-s4hana-cloud-connector-create-batch.md
canonical_url: https://docs.mulesoft.com/sap-s4hana-cloud-connector/latest/sap-s4hana-cloud-connector-create-batch
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7741bbe357d953d0d79360ebb452bd6bcd4c14eb565e44f039c09fa681ccadd3
description: MuleSoft Documentation Site
release: "2.9"
latest: true
---
---
product: SAP S/4HANA OData Connector
version: 2.9
is-latest-version: true
---

# SAP S/4HANA OData Connector 2.9 Batch Operations

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The batch processing feature is available in SAP S/4HANA OData Connector 2.1 and later.

You must follow the correct order for structural batch operations, which is as follows:

1.  Initiate the batch before adding any requests into it.

2.  Do not add requests to the batch or the change set after it is executed.

## Create a Batch Operation

To create and process a batch operation, you must:

1.  Place the **Initiate Batch** operation in the Mule flow, which returns a unique batch
    identifier.  
    This unique batch identifier must be stored, for example, in the flow variable, so that it can
    then be used to group the batch data operations under the common batch request.

2.  Use the **Create Change Set** operation to create a new change set.  
    This operation returns a unique change set identifier, which you then use in the **Batch
    Create**, **Batch Update**, **Delete Entity**, or **Batch Execute Function** operations to add
    them to the change set. Within a change set, requests are executed sequentially in the order
    they are added.

3.  When you complete the batch, use the **Execute Batch** operation to send the batch request.

The **Batch Create Entity**, **Batch Get Entity**, **Batch Query**, and **Batch Execute Function**
operations return a JSON result. However, the result of these operations cannot be read until the
**Execute Batch** operation is done.

If you attempt to read the result before the **Execute Batch** operation is executed, the connector
throws an exception. You can store the output of these operations, for instance, into a flow
variable, and access the output after the **Execute Batch** operation is executed.

After the **Execute Batch** operation is successfully executed, a summary is returned, which
contains basic information about the outcome of every batch operation that was included as part of
the batch operation. The detailed results of these batch operations are then available to read.

## Troubleshooting

Exceptions are thrown in the following circumstances:

- An operation references a batch identifier that is invalid, either because:

  - It was never initiated.

  - It was already processed as part of an **Execute Batch** operation.

- The change set identifier used in that batch operation is not valid.

## See Also

- [SAP S/4HANA OData Connector Reference](https://docs.mulesoft.com/sap-s4hana-cloud-connector/latest/sap-s4hana-cloud-connector-reference)

- [Salesforce Help](https://help.salesforce.com)
