Skip to content

MES and ERP integration: production orders, material consumption and confirmations

B2Bnetwork team · · 6 min

IT in manufacturing

In brief

MES and ERP integration comes down to a few messages with a clear data owner: the ERP sends the MES an order with the bill of materials and routing versions, and the MES sends back operation starts, confirmations of good quantity and scrap, material consumption with batch numbers and the finished goods receipt. Before writing code, settle three things: whether material is backflushed by the standard or posted by actual consumption, how often the MES confirms, and how a wrong confirmation is corrected. A daily reconciliation of order status in both systems catches messages that got lost on the way.

Who owns which data

Most integration problems come from the same data being editable in two places. The ISA-95 model (IEC 62264) splits responsibility: the ERP plans and accounts, the MES executes and records. This is covered in MES and ERP: who is responsible for what. In practice it pays to write an ownership table.

DataOwnerOther system
Item, bill of materials (BOM), routingERPMES receives a copy with a version number
Production order: quantity, due date, versionsERPMES does not change the quantity, it can request a change
Sequence of orders at a workstationMES or the scheduling systemERP sees the status only
Confirmation of good quantity and scrapMESERP posts it
Consumption of a raw material batchMESERP posts the goods issue
Finished goods receiptMES reports, ERP posts the goods receipt
In-process quality resultsMESERP receives the batch decision

If a process engineer edits a routing in the MES "because it is quicker", after a month the two systems have different standard times and costing stops adding up. The rule is simple: master data changes only at the owner, and the other system receives the new version.

Messages: the minimum set

An example for an order of 1,000 units with three operations:

  1. Order (ERP → MES): number, item, 1,000 units, due date, BOM version 4, routing version 2, receiving warehouse.
  2. Material issue (ERP → MES, optional): raw material batches issued to the order when the ERP runs the warehouse.
  3. Operation start (MES → ERP): operation 10 at workstation TO-03, started at 6:12. The ERP changes the order status.
  4. Confirmation (MES → ERP): operation 10, 600 good units, 12 scrapped with a defect code, machine and labor time.
  5. Consumption (MES → ERP): 312 kg of raw material from batch 25-1184 to the order, as a goods issue.
  6. Goods receipt (MES → ERP): 588 units of finished goods batch W-25-0931 into the warehouse.
  7. Completion (MES → ERP): the order is technically complete and the ERP can settle it.

Every message has its own identifier, and the ERP remembers the identifiers it has already posted. When the MES resends the same confirmation after a network failure, the ERP skips it instead of doubling production. This property, called idempotency, matters more than the choice of protocol.

Three decisions before you build the integration

Backflush or actual consumption. Backflushing removes material from stock in proportion to the confirmed quantity, according to the BOM. It is simple, but it hides overconsumption and gives no batch genealogy. Actual consumption requires scanning batches at the machine, but it shows variances and allows batch tracing. Many plants combine both: small parts are backflushed, while key raw materials tracked by batch are posted as actually used. How to analyze the gap between standard and actual usage is covered in Material usage versus the standard.

Confirmation frequency. Confirming after every unit loads the ERP and helps nobody. Confirming once a day means the warehouse and the planner see yesterday's state. A confirmation after each operation or each shift is usually enough, plus every agreed number of units for long orders.

Corrections. An operator adds a zero or confirms against the wrong order. The integration has to handle a correction as a separate message (a reversal and a new confirmation), not as a silent change to a record, because the ERP has already posted inventory documents. Agree how long corrections are allowed, for example until the order is closed or the accounting period ends.

Technology: queues, retries and reconciliation

The shop floor cannot stop because the ERP is in a maintenance window. The MES should therefore store messages locally and send them through a queue with retries. A message that fails after several attempts (for example an unknown item) goes to a separate error queue with its cause, and someone at the plant gets an alert. Exchange patterns like these are covered in Integration with ERP, and checking that messages flow at all in Integration monitoring.

Run a reconciliation report once a day: for each open order, good quantity, scrap and consumption according to the MES next to the same figures in the ERP. A difference means a lost or rejected message and should be explained the same day, before accounting closes the month. An AI Worker can run this comparison: the Material usage checker sets withdrawals against the standard for every order and drafts an explanation for the process engineer, while corrections to ERP documents wait for a person.

Testing the integration before go-live

MES and ERP integration is tested with scenarios, not single messages. A minimum list:

  • an order from release to settlement, with partial confirmations,
  • a confirmation with scrap and a defect code,
  • correcting a confirmation after posting,
  • a BOM version change in the ERP for an order already in progress,
  • a network outage in the middle of a shift and recovery with a backlog of messages,
  • the same message sent twice,
  • an unknown item or batch in a message.

Machine scenarios are best run on simulators, as in automated MES testing with virtual machines. The full implementation plan, in which integration is one of the steps, is described in MES implementation in a mid-sized plant.

We design and build message contracts, queues, tests and flow monitoring between MES, ERP and the warehouse as part of our System integration service.

Questions and answers

Do the MES and ERP have to come from the same vendor?

No. A single vendor's ready connectors speed up the start, but integrating systems from different vendors follows the same principles: a clear data owner, a versioned message contract and a queue with retries. Whether both systems have documented interfaces and a test environment matters more than the brand.

How often should the MES confirm production to the ERP?

Usually after each operation or once per shift, and every agreed number of units for long orders. Confirming every unit loads the ERP with no benefit, and confirming once a day leaves the warehouse and the planner working with yesterday's data. Set the frequency together with planning and accounting.

What happens to confirmations when the ERP is unavailable?

The MES stores them locally and sends them from the queue when the ERP is back. Thanks to message identifiers, the ERP does not post anything twice. The shop floor keeps working, and once the connection returns, the reconciliation report shows whether every queued confirmation arrived.

Does MES integration require changes to the ERP?

Often yes, though usually small ones: interface configuration, new order statuses, defect codes or material posting rules. Custom development is needed less often. Agree the scope of ERP changes before choosing the MES, because part of the cost and timeline depends on it.

What it looks like in a project

Connecting the shop floor with your business systems? Talk to an engineer who has worked on MES and OT.

Let's talk

Read more: IT in manufacturing

All in IT in manufacturing →