Hello
There is a component called PP-MES, which is responsible for the integration of production orders with MES systems. Here, the interface uses IDOC LOIPRO02, which is automatically called when the order is created or changed.
Please take a look on the PP-MES documentation on the link below:
Production Order Integration - ERP-MES Integration (PP-MES) - SAP Library
Best regards
Caetano Almeida