Introduction to SAP ME
SAP ME (Manufacturing Execution) is an important SAP module which evolved out of the acquisition of Visiprise by SAP for on-time and error-free enforcement of production orders represents. This manufacturing business solution enables global manufacturers to manage and control manufacturing and shop floor operations.
SAP ME is operated via production operator dashboards, which can be customized according to the work place. The production process can be configured for each part to provide full control of all productions routes including tests and rework.
To secure traceability for each part, assembly group, or component, all relevant production and quality data are collected on each production, assembly and test step. For further analysis of the data, powerful reporting functions are available.
Typical application areas for SAP ME are manufacturing and assembly plants with high demands on quality control, traceability and product documentation.
Manufacturers who implement SAP ME as part of their integrated manufacturing operations can do the following:
- Provide users with real-time visibility across entire enterprise
- Access to real-time manufacturing data to make quick and informed decisions
- Accurately track and manage WIP to ensure right products are being made at right time
- Optimize plant performance and profitability
- Improve quality and reduce variation through corrective action processes that prevent escape of defective product
Following is high-level architecture diagram of SAP ME 6.1
Fig: 1. SAP ME Architecture diagram
SAP ME ERP Integration:
The system landscape for the integration consists of the following components
- SAP NetWeaver 7.3.1 CE – EHP1
- SAP ERP (ECC 6.0)
- SAP Manufacturing Integration and Intelligence (SAP MII) 14.0 with SAP ME ERP Integration (SAPMEINT) subcomponent
- SAP Manufacturing Execution (SAP ME) 6.1
SAP ME ERP Integration (SAPMEINT)
SAPMEINT is one of the main components of SAP ME to enables the connectivity between the SAP ERP and the SAP ME components.
As it’s a sub-component of SAP Manufacturing Integration and Intelligence (MII), it runs on MII component only.
SAPMEINT consists of different connector to provide a way for an SAP ERP system to communicate with the SAP ME system and vice versa.
Using MII, SAPMEINT provides the following functionality:
• Standard interfaces between the SAP ERP and SAP ME systems using XSLTs for data transformation almost for all the message types.
• Robust and scalable process which allows the interface to be easily extended and customized to meet customers’ needs through data enrichment and/or customer specific configurable workflows for the different message types.
• Plant specific integration points for both inbound and outbound data processing.
SAPMEINT is configured through a Configuration Template which is called SAPMEINTCTC.
The Standard SAPMEINT interfaces are installed and configured using this SAPMEINTCTC wizard which comes with the installation package.
- Configuring Datasources in SAP NetWeaver Java AS SAPMEINTCTC creates two data sources, SAPMEINT and SAPMEWIP.
- Configuring MESYS User in SAP NetWeaver Creates the MESYS user in SAP NetWeaver where SAPMEINT and SAP ME are deployed to make any SAP ME Web Service calls
- Configuring Credentials in SAP MII Creates the credential SAPMEINT_ME_AUTH for web service call and SAPMEINT_ALE for BAPI call.
- Configuring Role in SAP NetWeaver Creates SAP ME specific role Role_SAPMEINT in SAP NetWeaver where SAP MII and SAPMEINT are deployed and running.
- Configuring SAP ERP ALE Creates logical system, TCP/IP RFC destination, RFC destination, port and partner profile and distribution model for all the relevant message types.
- Configuring Message Listener Creates the message (IDoc) listener in SAP NetWeaver to receive notifications of IDocs from SAP ERP server and download the IDoc
- Configuring Processing Rules Creates the processing rules in SAP MII Message Services for all the relevant message types.
- SAPMEINT Global Configuration Configures SAPMEINT Global Configuration properties with the values provided during the SAPMEINTCTC configuration process.
- Configuring Supported plant Configures supported SAP ME sites that correspond to SAP ERP plants during the SAPMEINTCTC execution
- Configuring the SAPMEINT workflow Configures SAPMEINT workflows with default values for all the message types
- Configuring the SAP ERP Server Connection Following the naming convention <Name of the IDoc Listener>_SAP_JCO SAPMEINTCTC Creates connection alias for SAP ERP server to make the BAPI calls.
- Configuring SAPMEINT MII Web Services in SAP NetWeaver Java AS Configures the SAP NetWeaver system properties for the SAP MII transactions web services to work
- Configuring the SAP MII Schedulers Creates all the default SAP MII Schedulers to process queued messages in SAPMEINT.
Note: SAPMEINTCTC wizard uses Business Logic Service (BLS) Visiprise/ERPShopFloorIntegration/frame/common/GenericInsertHelper and Visiprise/ERPShopFloorIntegration/frame/config/GlobalConfigHelper to insert all global config data, supported plant data and workflow configuration data in SAPMEINT_GLOBAL_CONFIG, SAPMEINT_SUPPORTED_PLANTS and SAPMEINT_WORKFLOW_CONFIG data tables respectively.
SAPMEINTCTC also uses BLS Visiprise/ERPShopFloorIntegration/frame/config/VerpsfiBuilder and Visiprise/ERPShopFloorIntegration/frame/config/WorkFlowConfigHelper to generate the XSLT and configure the in-built workflow for all the message types.
SAP ECC to SAP ME workflow :
SAPMEINT component of SAP MII has the capability to integrate shop floor ME system directly to the existing ECC applications. It’s a standard interface to send master and transactional data to shop floor. It also has the capability to provide a clear production operation view to the shop floor users.
Fig: 2. SAP ECC-MII-ME process flow
In this segment the main discussion will be about the data flow from the SAP ECC system to SAP ME system. It’s very much clear from the SAP help documentation that SAPMEINT has different workflow configuration to invoke ME web service to transfer the data to the shop floor from SAP MII after receiving the data from ECC.
As “Visiprise” is an in-built, deployed project for SAP ME and no detail technical information is available in SAP help documentation, it’s very challenging to develop any custom solution on top of the “Visiprise” project without knowing the detail transactional flow.
Almost for all the common business scenarios related to transactional and master data processing in MII for ME system, SAPMEINTCTC has the configurations for all the required messages in the message processing rules.
SAP MEINT component already has workflows for the default message type to send the IDOC data to SAP ME via a web service call.
Now it’s very essential for a new SAP ME developer to know on top of all these standard interfaces how a customized solution can be added.
To achieve any kind of customization in the SAP ME workflow, the ME developer needs to drill down the entire SAPMEINT workflow configuration and all the relevant designs to get well known about the in-built data flow.
In the rest of the parts of this document each and every steps of the workflow configuration will be explained.
As SAP MII receives IDOC messages from ECC through IDOC listener and SAP MII has one common message processing rule for all the IDOC message types.
Once MII receives IDOC, it gets queued up in the SAPMEINT_INBOUND_QUEUE and then processed by a scheduler.
SAP ME 6.1 has 4 active schedulers to process and clean messages from SAP ME database.
1. Scheduler InboundMessageEnqueuer runs a BLS called, Visiprise/ERPShopFloorIntegration/InboundEnqueuer/InboundEnqueuer to process the entire categorized IDOC message from the SAPMEINT_INBOUND_QUEUE.
This BLS basically queues up all these received IDOC messages from SAPMEINT_INBOUND_QUEUE i.e. the SAP MII message service to SAPMEINT integration queue. InboundEnqueuer transaction has 4 input parameters:
- No. of messages to be read from message service queue
- Boolean parameter to indicate if this BLS needs to delete the message from the SAPMEINT_INBOUND_QUEUE after the successful insertion of the messages in the integration message queue.
- As this BLS processes all the IDOC message types, it has one input parameter called message name to take “*” (asterisk) as the IDOC message type.
- It has another input parameter to take the IDOCListener name
Based on the no. of messages along with other input parameters, InboundEnqueuer BLS queries and reads the new IDOC messages from SAPMEINT_INBOUND_QUEUE. Then for each IDOC message it calls Visiprise/ERPShopFloorIntegration/services/AsyncDOCService to post the IDOC data to the integration queue. Following diagram gives a glimpse of the transactional flow for transferring data from Category Queue to Integration Queue.
Fig: 3. Transactional flow from Category Queue to Integration Queue
2. The Scheduler MessageEnqueuer executes a BLS called, Visiprise/ERPShopFloorIntegration/SAPMEMessageEnqueuer/SAPMEMessageEnqueuingDispatcher which has two input parameters –
- No. of messages to be read from outbound message queue
- Boolean parameter to indicate if this BLS needs to delete the message from the outbound queue after the successful insertion of the messages in the integration message queue.
Based on the input parameter this BLS reads the messages with “New” and “Retry” status from the outbound message queue and queue them in the integration message queue.
This outbound queue generally contains SAP ME data which gets inserted into SAPMEINT_MESSAGE_QUEUE table of the SAPMEINT data source.
Fig: 4. Transactional flow from Outbound Queue to Integration Queue
If the message gets queued up in the integration message queue successfully, this BLS deletes the message from the outbound message queue.
Fig: 5. BLS SAPMEMessageEnqueuingDispatcher
Once the message is queued up in the integration message queue, another scheduler called MessageDispatcher calls the BLS Visiprise/ERPShopFloorIntegration/frame/dispatchers/simpleDispatcher/SimpleMessageDispatcher, to dispatch the “queued” messages based on message types.
Fig: 6. BLS SimpleMessageDispatcher
This dispatcher actually triggers the SAPMEINT workflow for the corresponding message type. Following diagram depicts the transactional flow of the message processing using SAPMEINT workflow.
Fig: 7. Transactional flow from Integration Queue to Destination system through SAPMEINT Workflow
SAPMEINT has two queues:
1. One is outbound message queue
2. Another one is integration message queue.
These queues are nothing but two different in-built tables of SAPMEINT data source. Outbound message queue uses “SAPMEINT_ME_MESSAGE” table and on the other hand integration message queue uses “SAPMEINT_MESSAGE_QUEUE”.
SAPMEINT workflow processes the IDOC message based on the massage type. For each of message types one workflow is created. There are 3 types of workflow in SAPMEINT
- Standard workflow: transform the inbound message and transfer it to the either system (ECC/ME). This is the only workflow which can send the data to other system.
- Split workflow: based on certain criteria splits or breaks down the inbound message into multiple messages with different message type and transfer the data to the standard workflow.
- Correlation workflow: this one just has the opposite functionality of the split workflow. This workflow is created to merge different message type into one message and pass it to the standard workflow.
Any of these above mentioned workflows has in-built logic to get executed sequentially.
SAPMEINT has one table to store all these workflow configurations. SAPMEINT_WORKFLOW_CONFIG of SAPMEINT data server stores all the workflow configuration steps for each of message type.
Workflow has a common set of steps for executing the received message. As discussed in the above note that SAPMEINT_WORKFLOW_CONFIG table of SAPMEINT data source stores all the step names and their corresponding values. When a workflow gets created/modified in MII, all the input values get inserted / updated in SAPMEINT_WORKFLOW_CONFIG table .Based on the message type, workflow gets triggered and executed sequentially.
For message type “LOIPRO01” SAPMEINT_WORKFLOW_CONFIG table contains the following field:
Fig: 8. Workflow data from SAPMEINT_WORKFLOW_CONFIG table for LOIPRO01
All the configurations are defined in the similar way for invoking web service, handling web service response, success and failure as well.
Fig: 9. Workflow for LOIPRO01
To execute each of the above configuration steps, one BLS called Visiprise/ERPShopFloorIntegration/frame/workflow/GenericTxnDelegate, works in the background to give the preference to customer configuration over the partner and standard configuration.
It delegates the BLS to the corresponding handler transaction based on the customer and partner transaction information from the workflow configuration.
Fig: 10. BLS GenericTxnDelegate
At any point of execution of the workflow this BLS passes the following parameters to the corresponding related BLS i.e. different handler transaction.
Fig: 11. Input Properties of BLS GenericTxnDelegate
- Here customer and partner BLS names and params are custom defined BLS name and input params.
- inputXML is the inbound message XML
- params is as same as BLS params.
- plant value gets retrieved from the queued message XML using XML path of the plant parameter of the “Workflow Handler Parameters” field.
- recordId which is a GUID is the “ID” of the integration message queue monitor
- typeId is the message type
- BLS is the default ME BLS for the workflow
Fig: 12. Input parameters plant, message type and identifier for LOIPRO01 workflow
This set of input parameters are common across and mostly used in all the transactions related to the workflow.
To call ME web service for each of the message types, workflow has a configuration parameter called Service Transaction to call the default service of ME.
BLS, Visiprise/ERPShopFloorIntegration/frame/workflow/MEWebService, internally calls two transactions to make a call to ME web service.
- Visiprise/ERPShopFloorIntegration/frame/common/InputParamsParser: takes semicolon separated “params” to get the web service name from the “Service BLS Parameters” of the workflow. It derives and returns the serviceUrl based on the “param” passed by the called BLS i.e. MEWebService.
Using plant code, the MEWebService BLS retrieves the SAP ME Host URL from the SAPMEINT_SUPPORTED_PLANTS table of SAPMEINT data source.
Note: This entire Global configuration is done by SAPMEINTCTC wizard at the time of the SAPMEINT configuration.
- Visiprise/ERPShopFloorIntegration/frame/workflow/WebServiceDelegate: gets the ME web service Url for the plant from MEWebService BLS , sets the response time by using the input parameter from the workflow configuration and posts the Post-XSLT message to the MII message service using HTTP Post service as SOAP message.
Finally to create or update the record in the SAPMEWIP and ODS database some rules are defined in ME maintenance pages. After having a successful SAP ME web service call, this web service directly creates or updates the record in the SAPMEWIP database.
Based on the ODS rule defined in the ODS Rule Maintenance page this records get extracted from the WIP database for the storage into ODS tables.
For more details:
Once the Service Transaction gets executed, Pass or Fail handler transaction gets executed to accomplish the post processing of the inbound message.