DMC, Inc.

How to Integrate SAP Production Orders with FactoryTalk Batch

Production orders, recipes, and batch execution data often live in separate systems, and this setup can routinely create challenges for manufacturers and operations teams. Duplicate data entries, inconsistent information, and inefficient workflows all lead to gaps in critical data.

However, there’s a relatively simple solution that can help greatly reduce issues with data quality and workflow friction: integrating SAP and FactoryTalk Batch to transform production orders into executable batches.

In this article, we’ll explore how to navigate the FactoryTalk Batch Enterprise Integration (EI) API, how SAP production orders can automatically create batches, and the workflow benefits this integration provides across manufacturing operations.

Why Integrate SAP and FactoryTalk Batch?

Production orders often originate in SAP, while FactoryTalk Batch manages batch execution. Without some level of automation, operators may need to manually recreate production information in multiple systems, greatly increasing effort as well as the likelihood of errors.

By connecting SAP to the FactoryTalk Batch Enterprise Integration (EI) API, production orders can be translated directly into FactoryTalk Batch batches. This allows recipe, quantity, material, and order information to flow automatically from the ERP system to the batch system. This can lead to:

  • A reduced need for manual data entry.
  • Improved data consistency.
  • Better traceability between business and manufacturing systems.
  • Faster batch creation and execution.
  • A foundation for broader manufacturing automation.

The EI API serves as the bridge between SAP and FactoryTalk Batch, providing a REST-based interface that external applications can use to create and manage batches programmatically.

Integration architecture diagram connecting an enterprise resource planning system to a plant-floor batch control system to programmable logic

How the Enterprise Integration API Works

The FactoryTalk Batch Enterprise Integration (EI) API acts as a communication layer between FactoryTalk Batch and external systems. Instead of the operator manually entering the production information needed to create a batch, applications can send requests directly to the API, which then creates and manages batches within FactoryTalk Batch.

In a typical integration, SAP might create a production order with details about what needs to be made, which recipe to use, how much to produce, and required materials. SAP sends the details to the EI API, which validates the request and forwards it to the FactoryTalk Batch Server. FactoryTalk Batch can then create the batch and prepare it for execution.

The EI API uses standard HTTP requests and JSON payloads, making it accessible with any platform capable of making a web request. This allows manufacturers to integrate FactoryTalk Batch with an ERP system, MES platforms, middleware applications, as well as custom software solutions. To help developers understand and test the available functionality, the EI API includes a Swagger interface that documents the available endpoints, request schemas, and response formats.

Enterprise Integration API Swagger/OpenAPI documentation interface with a POST /batches endpoint expanded to instantiate a control recipe
The Swagger interface provides documentation and testing capabilities for all available API endpoints.

Creating a Batch from an SAP Production Order

Once SAP and FactoryTalkBatch are connected, creating a batch becomes a straightforward, nearly automated process. SAP generates a production order, translates the order data into a CreateBatch request, and the FactoryTalk Batch Server creates the batch automatically. Because the information already exists in SAP, operators don’t have to re-enter any information, saving significant time, reducing the likelihood of errors, and automating part of the production order process.

SAP Production Order

As mentioned, the process begins with a production order in SAP. While the exact fields vary by implementation, a typical order contains the data required to create and execute a batch. This information already exists within the ERP system, so operators, again, don’t need to recreate it manually in FactoryTalk Batch.

SAP FieldExample Value
Order Number10001234
RecipePROD_A
Quantity500
MaterialMAT001

CreateBatch Request

The next step is mapping the SAP production-order data to a CreateBatch request.

SAP FieldCreateBatch Field
Order NumberBatch ID
RecipeRecipe
QuantityScale
MaterialMaterial

Once the mapping is complete, the integration layer generates a JSON payload and submits it to the FactoryTalk Batch Enterprise Integration API.

JSON
{
"createValues": {
"recipe": "PROD_A",
"batchid": "10001234",
"scale": "500",
"description": "",
"formulation": {
  			"name": "formulation_name"
},
"steps": 
"materials": [
  			{
    				"material": "MAT001"
  			}
]
}
}

The EI API receives the request, validates the payload, and forwards it to the FactoryTalk Batch Server.

Swagger UI interface for a POST /batches API endpoint with an interactive JSON request body input

Batch Created in FactoryTalk Batch

If the request is valid, FactoryTalk Batch creates a new batch using the information supplied by SAP.

From the operator’s perspective, the batch appears just like one that was created manually through Batch View. The difference is that the data originated in SAP and was transferred automatically through the EI API.

At this point, operators can review the batch, start execution, monitor progress, and perform all normal FactoryTalk Batch operations.

This workflow demonstrates the EI API’s primary value: information entered once in SAP can be used directly by FactoryTalk Batch, reducing manual effort and helping ensure consistency between business and manufacturing systems.

FactoryTalk BatchView interface from Rockwell Automation, displaying a batch labeled 10001234 in a READY status

Testing and Troubleshooting

Even when the SAP-to-Batch integration is fully implemented, it’s still useful to validate requests independently before troubleshooting the SAP side of the solution. This is where tools like Postman come in handy, providing a quick way to test API connectivity, verify request payloads, and review responses returned by the FactoryTalk Batch EI API.

Using Postman to Test Requests

Diagnosing integration issues can be frustrating, but there are simple tools that can help make the process go smoothly. When diagnosing integration issues, it is often helpful to start by sending the CreateBatch request directly through Postman. If the request succeeds in Postman but fails from SAP or middleware, the issue likely exists within the integration layer rather than the EI API itself.

A successful test should return a response indicating that the Batch Server created and accepted the batch.

API documentation JSON structure for the 200 Server Success Response

Authentication Issues

One of the most common integration problems is authentication failure. If the API rejects a request before it reaches the Batch Server, verify that:

  • The correct API endpoint is being used.
  • Authentication credentials are valid.
  • Required authorization headers are present.
  • The service account has sufficient permissions.

Testing the same request through Swagger or Postman can help isolate authentication-related issues.

Missing Parameters

Many recipes require specific parameters to create a batch successfully. If required values are omitted from the request payload, the API may reject the request or return an error. Some common reasons for this include:

  • Missing recipe parameters.
  • Missing material assignments.
  • Missing formulation selections.

Review the CreateBatch schema in Swagger to ensure all required fields are populated.

Invalid Recipes

The recipe specified in the request must exist and be available to the Batch Server.

If an invalid recipe name is supplied, verify:

  • The recipe name matches the deployed recipe
  • The recipe is available on the target Batch Server
  • The spelling and capitalization are correct

Many batch creation failures can be traced back to simple configuration mismatches between SAP master data and FactoryTalk Batch recipe names.

Verifying Successful Batch Creation

A successful API response is only the first step. After submitting a CreateBatch request, verify that the batch was actually created in FactoryTalk Batch.

A typical validation process includes:

  1. Confirm the API returned a successful response.
  2. Open Batch View.
  3. Locate the newly created batch.
  4. Verify the Batch ID matches the originating SAP production order.
  5. Review recipe, quantity, and parameter values.

Key Takeaways

Integrating SAP with FactoryTalk Batch through the Enterprise Integration (EI) API enables production orders to drive batch creation automatically, reducing manual data entry and improving consistency between business and manufacturing systems.

While this example focused on SAP, the same approach can be applied to MES platforms, middleware applications, and other systems capable of making REST API calls.

Need help implementing some of these steps? Contact DMC to learn more!

DMC’s Automation experts can help you take your project to the next level, optimizing data efficiency and scalability.