Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Community

SAP Community  Products and Technology  Technology  Technology Blogs by Members

 Integrate it! - SAP and MES integration. Step-by-s...

Technology Blogs by Members


Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP
products, technology, and events. Get in the mix!

All community  What are you looking for today?

Integrate it! - SAP and MES integration. Step-by-step guide

gorbenkoteh
Active Participant

‎04-16-2020 4:44 PM

 18 Kudos

Quote.

"The increased scale and complexity of SAP and non-SAP systems


challenges require that we look for

ways to simplify the system-integration requirements"

This quote about a series of blog-posts ("Integrate it...") about integration between
different SAP and non-SAP systems

Another posts from this series (The list is being updated.)



Integrate it! - Qlick View/Sense and SAP integration. Step-by-step guide

About.

Manufacturing execution systems (MES) are computerized systems used in


manufacturing, to track and document the transformation of raw materials to finished
goods. MES provides information that helps manufacturing decision-makers
understand how current conditions on the plant floor can be optimized to improve
production output. MES works in real-time to enable the control of multiple elements
of the production process (e.g. inputs, personnel, machines, and support services).

MES may operate across multiple function areas, for example, management of
product definitions across the product life-cycle, resource scheduling, order execution,
and dispatch, production analysis and downtime management for overall equipment
effectiveness (OEE), product quality, or materials track and trace. MES creates the
"as-built" record, capturing the data, processes, and outcomes of the manufacturing
process. This can be especially important in regulated industries, such as food and
beverage or pharmaceutical, where documentation and proof of processes, events,
and actions may be required.

Benefits of MES:

1.
Reduced waste, re-work, and scrap, including quicker setup times

2.
More accurate capture of cost-information (e.g. labor, scrap, downtime, and
tooling)

3.
Increased uptime

4.
Incorporate paperless workflow activities

5.
Manufacturing operations traceability

6.
Decreases downtime and easy fault finding

7.
Reduced inventory, through the eradication of just-in-case inventory

Common use cases where MES system integrated with SAP EWM and/or SAP ERP
systems

MES-system consume a master-data (Materials, Batches, Containers and so on) from


ERP-system

Prerequisites.

You want to know more about SAP-MES Integration with SAP PI/PO in the outline.

Resolution.

Step 0. Intro

In this integration scenario:


SAP ERP - SAP S/4HANA 

Message bus (integration broker) - SAP PO

Let's first take a quick look at the integration scenario blueprint:

Step 1. Examples of message flow

1.
Materials from ERP to MES

2.
Batches from ERP to MES

3.
Deliveries from ERP to MES

4.
Handle Units from ERP to MES

5.
Process Orders from ERP to MES

6.
Materials from MES to ERP

Step 2. Integration from SAP PO Standpoint

Step 2.1.From the Enteprise Service Repository (ESR)


perspective:

Describe message flow from Step 1

1.Software Component Version Name

2.Namespace

3.DataTypes (DT) objects

Example of Material flow

Elements: MaterialType, MaterialNumber, Brand and so on


4. MessageTypes (MT) objects will be generated automatically from DT

5. In/Out Service Interface (SI) objects

Assign Request Role to created MT and Fault Role to Fault Message Type

6.Receive / Send Actions

Assign Receive Action with In Service Interface

Assign Send Action with Out Service Interface


Step 2.2. From the Integration Builder (IB) perspective

For Web-service (SOAP):

1.
the Route to/from MES System

Configuration Component Without Party - Bussines System - (for example


BSYSTEM_MES_QAS)

Adapter Type - SOAP

SOAP Sender Communication Channel

SOAP Receiver Communication Channel (Target URL to MES Web Service with
Credentials and Port Number)

Configuration Component Without Party - Bussines System - (for example


BSYSTEM_S4HANA_CLIENTXXX_QAS)

Adapter Type - SOAP

Adapter - Sender

Transport Protocol - HTTP

Addressing Type - HTTP Destination

HTTP Destination - Name of HTTP Destination


SOAP Sender example: 

2.
The route to/from ERP System

Configuration Component Without Party - Bussines System - (for example


BSYSTEM_MES_QAS)

Adapter Type - SOAP

Adapter - Receiver

SOAP Sender Communication Channel

SOAP Receiver Communication Channel (Target URL to MES Web Service with
Credentials and Port Number))

SOAP Receiver Example:


For IDoc Integration:

Configuration Component Without Party - Bussines System - <SID>CLNT<CLNT>


(Name suggestion,for example)

Communication Channel settings:

Bussiness System - <SID>CLNT<CLNT> (Name suggestion,for example)

Adapter Type - IDoc_AAE

Adapter Type - Receiver

Transport Protocol - tRFC

Messgae Protocol - IDOC XML

Adapter Engine - Central Adapter Engine

IDoc Sender Example:


For Integrated Configuration (ICO) in IB:

For Configuration Scenario in IB:

For example Batch Replication Configuration Scenario.

N.B. More than one system can be as a target system for a Master Data workflow

Model Configuration:

Source system - SAP ERP

Target systems - MES, 3d party BI software and so on


Step 3. Integration from ERP standpoint

Step 3.1. IDOC Integration

N.B.

IDoc, short for Intermediate Document, is a SAP document format for business
transaction data transfers. The IDoc itself is a structured Text-File, that means IDocs
can be used on all platforms, there is no need to translate binary data

SAP transactions:

Step 3.1.1. Settings in SM59

Transaction SM59 - Configuration of RFC Connections

Connection Type - T (TCP/IP Connections)

Gateway Host - Path to SAP PI/PO

Program ID -

1)A RfcAdapter sender channel registers itself with this Program ID as a RFC-Server at
the SAP Gateway. The sending system uses the same Program ID to identify the RFC-
Server at the SAP Gateway.

During the sending system sends some RFC calls, the SAP Gateway will search its
registration list for the Program ID supplied by the sending system

2)The Program ID is case sensitive.

3)The same Program ID should be given in RFC Sender Channel.


Gateway service - sapgw<SID> 

Step 3.1.2. Settings in WE31

Transaction - WE31 - Development IDoc Segment

Bindings between IDoc Segment and Data Elements

For example Segment type E1BATMAS and Fields in Segment like as MATERIAL

Step 3.1.3. Settings in WE81

Transaction - WE81 - Logical Message Types

For example:

SAP Object - MATERIAL has a standard IDoc Message Type MATMAS. In transaction
WE81 we can create custom message type, for example, ZMATMAS.

Step 3.1.4. Settings in SM30

Transaction - SM30 - Maintain Table View - V_TBDA2

Activate change pointer for custom Message Type

Step 3.1.5. Settings in WE82

Transaction - WE82 - Assign Messages for IDoc Type

Binding between custom message type and basic message type.

Step 3.1.6. Settings in BD61

Transaction - BD61 - Activate Change Pointers Generally

Set Change pointers activated - generally.


Step 3.1.7. Settings in BD50

Transaction - BD50 - Activate Change Pointers for Message Type

Activate Change Pointer for our Custom message type

Step 3.1.8. Settings in BD52

Transaction - BD52 - Activ. Change Pointer per chng doc it

Bindings between change document items and custom message type

For example bindings between Message type ZXXX and

CHARGE_LM - Batch master (with a long material number)

MCHA - Batches (table)

LICHA - LICHA Supplier Batch Number (field)


Step 3.1.9. Settings in BD64

Transaction - BD64 - Display Distribution Model

We can add a message to the Distributon model.

1.Create Distribution model

2.Add to Distribution model ERP and PI systems

3. Add to Distribution Model Message Type. For example LOIPRO (Production


Order)

Step 3.1.10. Settings in WE21

Transaction - WE21 - Ports in IDoc processing

Binding IDoc port with RFC port defined in step 3.1.1

Step 3.1.11. Settings in WE20

Transaction - WE20 - Partner profiles


Bindings between Message Type and Receiver Port 

PARTNER TYPE

Partner type/role is used to identify partners within the sap systems. Partner type is
KU for a customer, LI for vendor and LS for Logical System.
Step 3.2. RFC Integration 

Step 3.2.1. SPROXY

Transaction - SPROXY - Enterprise Repository Browser

Consume SAP PO ESR objects here.

Bindings between generated z-structure from SAP PO Data Type and you custom
code which populated data to this z-structure

Step 3.2.2. ABAP Development

Transaction - SE80 - Object Navigator and other development tools like an SM30 and
SE38

(creation of package / subpackages, structures, function modules, programs and so


on)
For example Generated Proxy Z-Structure for Material 

Step 3.2.3. Scheduling

Transaction - SM36 - Schedule Background Job

For IDOC:

SE38 -> Create variant for each message type used in SAP-MES integration.
RBDMIDOC Report -> Create Variant

SM36 -> Create Background job for each variant of RBDMIDOC Report

Periodic time, for example, each 5 minutes

For RFC:

SM36 -> Create Background job for each custom ABAP program which sends data to integration

Step 4. Integration from MES standpoint

A quick look at the integration scenario from the MES standpoint.

For example MES system with integration part based on Apache Camel.

Small quote about architecture:

"ERP data is exchanged as XML text files that comply with a selected set of
SAPIDOCs. The IDOCs from a file system is transformed from XML to
common business objects and delivered to FTPC through JMS message
queues. Using an event sheet, Shop Operations Server reads the messages
from this queue and launches a specific activity set to process each
message."

Architecture and configuration:


Integration Configuration:

Java Message Service Providers:

Inbound Configuration

Outbound Configuration

Step 5. Monitoring

Monitoring from the ERP side:

Transaction - WE02 (Display IDoc)

Transaction - WE05 (IDoc List)

Example:

Message 29 - Error in ALE service


Transaction - BD87 - Status Monitor for ALE Messages

Status Monitor for ALE Messages for example status for LOIPRO (Production Order)

Transaction - SXMB_MONI (Integration Engine Monitoring)

Monitor for Processed XML Messages

Transaction SMQS - TRFC Monitor


Monitoring from the SAP PO side:

SAP Netweaver -> Configuration and Monitoring Home

Adapter Engine ->Message Monitor

Monitoring from the MES side:


This step depends on the type of MES system. For Rockwell Factory Talk this is 
Inbound Events Monitor

Troubleshooting.

Transaction SMQS - TRFC Monitor

Problem:

Queue in error " Failed to resolve repository reference @XI_IDOC_DE FAULT_DESTINATION "

Resolution:

SAP PI - SAP Netweaver Administrator - Configuration - Destinations

Check credentials, ping, etc for destination XI_IDOC_DE FAULT_DESTINATION

Links.

Idoc Error Status "Entry in outbound table not found"

https://answers.sap.com/questions/4713524/idoc-error-status-entry-in-outbound-
table-not-foun.html

IDoc Basics For Functional Consultants

https://blogs.sap.com/2012/12/31/idoc-basics-for-functional-consultants/

137412 - Creation of the batch - no change pointer for ALE

https://launchpad.support.sap.com/#/notes/137412

Conclusion.

SAP-MES Integration with SAP PI/PO in outline provided


SAP Managed Tags:

SAP Process Orchestration, Basis Technology

Tags:

MES

3 Comments

gorbenkoteh
Active Participant

‎10-07-2020 3:44 PM

 1 Kudo

Update 07/10/2020. Section Troubleshooting was added

Sreenivasa
Newcomer

‎02-24-2022 2:38 PM

 0 Kudos

Can you share same process with CPI.



former_member845027
Member

‎03-07-2023 8:33 AM

 0 Kudos

Can you please share the same process with CPI/CI

 You must be a registered user to add a comment. If you've already registered,


sign in. Otherwise, register and sign in.

Comment

Labels In This Area


"automatische backups" 1 "regelmäßige sicherung" 1

505 Technology Updates​53 1 ABAP 12 ABAP CDS Views 1

ABAP CDS Views - BW Extraction 1 ABAP CDS Views - CDC (Change Data Capture) 1

ABAP Cloud 1 ABAP Development 4 ABAP Platform Trial 1

ABAP Programming 2 access data from SAP Datasphere directly from Snowflake 1

Access data from SAP datasphere to Qliksense 1 action 1 adapter modules 1

Addon 1 Adobe Document Services 1 ADS 1 ADS Config 1

ADS with ABAP 1 ADS with Java 1 ADT 1 Advance Shipping and Receiving 1

Advanced Event Mesh 3 AEM 1 AI 6 AI Launchpad 1 AI Projects 1

AIML 9 Alert in Sap analytical cloud 1 Amazon S3 1 Analytical Dataset 1

Analytical Model 1 Analytics 1 Analyze Workload Data 1 annotations 1

API 1 API and Integration 3 API Call 1 Application Architecture 1

Application Development 5 Application Development for SAP HANA Cloud 3

Applications and Business Processes (AP) 1 Artificial Intelligence 1

Artificial Intelligence (AI) 4


Artificial Intelligence (AI) 1 Business Trends 363 Business Trends​8 Digital… 1 
Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise 1

Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise Oil Gas IoT… 1

Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise… 1

ASE 1 ASR 2 ASUG 1 Attachments 1 Authorisations 1

Automating Processes 1 Automation 1 aws 2 Azure AI Studio 1

B2B Integration 1 Backorder Processing 1 Backup 1 Backup and Recovery 1

Backup schedule 1 Bank 1 basis 2 Basis Monitoring & Tcodes with Key notes 2

Batch Management 1 Best Practice 1 bitcoin 1 Blockchain 3 BOP in aATP 1

BOP Segments 1 BOP Strategies 1 BOP Variant 1 BPC 1 BPC LIVE 1

BTP 8 BTP Destination 2 Business AI 1 Business and IT Integration 1

Business application stu 1 Business Architecture 1

Business Communication Services 1 Business Continuity 1 Business Data Fabric 3

Business Partner 12 Business Partner Master Data 10

Business Technology Platform 2 Business Trends 1 CA 1 calculation view 1

CAP 1 Capgemini 1

Catalyst for Efficiency: Revolutionizing SAP Integration Suite with Artificial Intelligence… 1

CCMS 2 CDQ 12 CDS 1 Cental Finance 1 Certificates 1 CFL 1

Related Content
Integrate C4P-Resource Management with SAP Analytics Cloud or SAP
DataSphere 
in Technology Blogs by SAP Thursday

Exploring Integration Options in SAP Datasphere with the focus on using SAP
extractors 
in Technology Blogs by SAP Thursday

Trigger a process in SAP Build Process Automation from SAP Build Apps without
using API [Sneak Peek] 
in Technology Blogs by SAP Thursday

3rd Party integration for SAP Public Cloud 


in Technology Q&A Thursday

Integration Suite - DataStore - Recommendations 


in Technology Q&A Thursday

Popular Blog Posts

SAP PI for Beginners

former_member200339
Participant

 691175  151  378

Follow

Privacy Terms of Use

Copyright Legal Disclosure

Trademark Newsletter

ABAP 7.40 Quick Reference


Support Cookie Preferences

You might also like