Integrating MES and SAP means creating a two-way flow between ERP-level planning and what actually happens on the production lines. To put it simply, SAP S/4HANA manages orders, materials, bills of materials, cycles, availability, and business processes, while the Manufacturing Execution System captures and processes information related to production execution.

An integration project between SAP MES must therefore precisely define which information belongs to the ERP, which information must be managed at the plant level, and when the two systems must synchronize.

This initial line of reasoning is based on ISA-95, the international standard for integration between enterprise systems and industrial control systems. In the ISA-95 model, ERP operates at Level 4, which is dedicated to business planning and logistics, while MES and Manufacturing Operations Management are primarily located at Level 3, the level of manufacturing operations.

MES and SAP S/4HANA: The Line Between ERP and the Factory

SAP S/4HANA primarily focuses on production planning and business management. It maintains material master data, bills of materials, cycles, and work centers; generates and manages production orders; manages procurement and availability; and receives the information needed to update inventory, costs, and order status.

MES brings this information to the shop floor. Here, the order is translated into tasks and processes that operators, machines, and production lines must carry out. The system can manage sequences and operating instructions and perform activity logging, tracking, and telemetry.

This separation is also reflected in the architecture of SAP Digital Manufacturing: SAP S/4HANA remains the system of record for master data, while Digital Manufacturing serves as the system of record for information related to work in process. Defining this ownership correctly prevents the ERP and MES from independently modifying the same object, which would create alignment issues that are difficult to manage over time.

MES and SAP S4HANA

What data is exchanged between MES and SAP?

The flow of information is normally bidirectional. SAP provides the factory system with the context needed to carry out production; the MES reports back on what actually happened. Materials, BOMs, production or process orders, batches, and other information necessary for execution can be transferred from the ERP to the MES.

In the reverse direction, the MES can send production quantities, scrap, component consumption, production times, progress reports, and order confirmations to SAP.
This information interacts directly with the processes managed by the ERP. For example, an order confirmation can update the order status; yield and scrap data feed into production reports; material consumption updates inventory levels; and production times can be used for cost accounting and cost management.

It should be clarified, however, that it is not necessary—and often not advisable—to transfer all data generated by machines to SAP. A PLC may generate information at frequencies that are incompatible with the ERP’s transactional processes. The MES must therefore contextualize and aggregate field signals before sending only the data that has actual business significance to the enterprise systems.

Three Models of SAP MES Integration

The architecture depends on the application landscape, the degree of process standardization, the geographic distribution of the plants, and the solutions already in place on the production lines. The following, however, are three integration models that we present as examples.

Model Features Typical Scenario
SAP S/4HANA + SAP Digital Manufacturing SAP ERP integrated with the SAP Cloud MOM platform New projects, multi-plant standardization
SAP S/4HANA + Third-Party MES ERP connected to a vertical MES via APIs, middleware, IDocs, or other services An established, specialized MES
Hybrid or Legacy Architecture Coexistence of SAP ME, SAP MII, proprietary MES systems, and new components Gradual transformations

SAP S/4HANA and SAP Digital Manufacturing

SAP Digital Manufacturing is SAP’s cloud platform for manufacturing operations management. It is based on the SAP Business Technology Platform and integrates execution, resource orchestration, analytics, and operational monitoring tools.

The integration with S/4HANA includes standardized scenarios and objects. With SAP S/4HANA Cloud Public Edition, for example, communication solutions are already available for materials, work centers, BOMs, goods movements, batches, routings, orders, and quality. For on-premises environments or hybrid configurations with third-party applications, SAP Cloud Integration, Data Replication Framework, Cloud Connector, OData, and other services can be utilized.

SAP S/4HANA and Third-Party MES Systems

As we mentioned above, using SAP ERP does not necessarily mean adopting an SAP MES; many plants use vertical platforms that incorporate years of configurations, recipes, line logic, and OT integrations, which, due to their specific nature, cannot be easily replaced.

SAP S/4HANA explicitly supports integration with third-party manufacturing execution systems. For example, it provides scenarios for transferring production orders, planned orders, and goods movements, as well as the use of the Data Replication Framework for various types of data and the availability of OData APIs for specific operations.

In short, the main issue is, above all, establishing a stable integration between ERP and MES. The middleware should handle the transport, transformation, and control of messages, while avoiding the incorporation of business logic that belongs to the application systems.

The Challenge of Landscape Legacies

In manufacturing companies with multiple plants, it is common to find technologies from different generations. SAP ME, SAP MII, proprietary MES systems, in-house applications, SCADA, historians, and new cloud components may all coexist.

Replacing the entire architecture all at once can pose significant operational risks. Integration then becomes part of a roadmap in which it is necessary to distinguish between the applications to be retained, those to be replaced, and the interfaces that must remain stable during the transition.

In short, for those using established systems, this does not result in an automatic migration. It is necessary to evaluate dependencies, industrial processes, customizations, and the lifecycles of individual plants, while temporarily retaining reliable components when an immediate replacement does not offer sufficient benefits.

Benefits of Integrating MES and SAP

As we can surmise, the most direct benefit of integration stems from the continuity of information between planning and execution. When the order is automatically transferred to the MES and progress data is fed back to SAP, production and business functions work on the same industrial process using consistent information.

Manual data entry is also reduced. Production quantities, times, consumption, and scrap can be recorded in real time and transferred to management systems without the need for subsequent reconstruction using spreadsheets or separate entries.

A third aspect concerns traceability. Orders, batches, components, process parameters, controls, and the resulting product can be linked within the same information flow. In this case, the MES serves to contextualize data from the OT level and objects managed by enterprise systems.

The Elements to Be Managed

The effectiveness of integration goes beyond a simple technical connection.

The first concernsdata ownership: it must be clear which system can create or modify materials, orders, cycles, quantities, and statuses.

Semantic alignment follows. Work center, operation, phase, reason code, unit of measure, batch, and statuses must have consistent mappings across systems.

The chronological order of the messages must also be managed. A confirmation should not arrive before the message to which it refers, and a change in the order must not compromise operations already performed on the MES.

Equally important is exception handling: timeouts, duplicates, unavailability, and rejected data must be identifiable, reprocessable, and reconcilable.

Finally, cybersecurity and business continuity must be taken into account. Connecting IT and OT increases interdependencies between different environments. Segmentation, authentication, authorizations, encryption, and the ability to handle temporary outages must be defined alongside the integration architecture.

Regesta and the Integration Between Management Systems and the Factory

For us at Regesta, the SAP MES integration is part of a broader approach to Smart Manufacturing, in which ERP, production systems, and OT technologies are integrated based on the actual landscape in place at the plants.

Our Group’s expertise includes integration with third-party field systems, SAP ME, SAP MII, SAP Digital Manufacturing, and MES solutions developed for specific needs, along with features such as OEE, nonconformance management, PLM integration, paperless production, and visual inspection.

In our view, however, technology is only one part of the project. Before defining APIs, middleware, and protocols, it is necessary to establish ownership, granularity, update frequency, and error handling for each exchanged object.

It is this approach that enables the creation of an integrated system in which the MES manages production execution and SAP receives reliable information to update planning, logistics, quality, cost management, and operational control, while maintaining a clear separation of responsibilities between the factory and enterprise systems.

Would you like to explore these topics further with our experts?

Schedule a call and tell us about your needs.