When there is a dependency between IDOC message types while processing or distributing, IDOCs must be processed in a ser...
Contents Introduction .................................................................................................................................................. 2 Basics steps to follow .................................................................................................................................... 2 Example ..................................................................................................................................................... 2 Steps to follow .......................................................................................................................................... 3 Create Logical Systems.......................................................................................................................... 3 Create Distribution Model View ........................................................................................................... 3 Generate Partner Profile ....................................................................................................................... 8 Define & Configure serialization group ............................................................................................... 11 PI Mapping .......................................................................................................................................... 14 Testing ................................................................................................................................................. 16
Introduction There are business requirements where you need to process multiple IDOC message types in a serialized manner using PI, immediately without a scheduled batch job. I.e.
Customer master with address master ( DEBMAS with ADRMAS) Vendor master with address master ( CREMAS with ADRMAS) Info record master with vendor master & material master (INFREC with MATMAS & CREMAS) Etc.
In order to process these IDOCs successfully, you must process them in a sequence. It is not necessary IDOCs to be for master data distribution, you can serialize any message type.
Basics steps to follow
Define a Logical system
Create a distribution model View
Generate partner profile
Generate distribution model for the model view created
Define serialization group & configure inbound processing
Create PI mapping using ADRMAS03, CREMAS05 & SERDAT01
Define operation mapping
Create receiver determination
Example Some of the address details are not available in CREMAS IDOC itself, hence we need to process both address master and the vendor master IDOCs using serialization sent from PI. First need to update the address master then the vendor (Creditor) Master.
Steps to follow Create Logical Systems Go to the transaction SALE Expand the node in IMG:
Basic settings -> Logical System -> Define Logical Systems
Create Distribution Model View Expand the node in IMG:
Modeling and Implementing Business Process -> Maintain Distribution Model and Distribute Views
Switch to the change mode
Create a new model view
Enter the short text and the technical name based on the requirement
The new distribution model view will be displayed in the list
And then save.
Predefined Business processes can be used to generate the distribution models for master data. This is more like a template that you can use. You can create distribution models manually also.
Go back and then go to the below IMG path
Modelling and Implementing Business Processes -> Configure Predefined ALE Business Processes -> Logistics -> Master Data Distribution -> Proposal for distribution model: Customer and vendor masters
Enter the corresponding values and execute in Test mode first
SAP will provide a proposal with a distribution model that will be created for the model view
Go back and execute without the test mode.
Go to the IMG
Modeling and Implementing Business Process -> Maintain Distribution Model and Distribute Views Or the transaction BD64
Confirm the distribution model that has been generated. Below are the generated message types and BAPIs for inbound Vendor Master Distribution using PI to transfer immediately
Generate Partner Profile Go to the IMG: Modelling and Implementing Business Processes -> Partner Profiles -> Generate Partner Profiles
Enter below values in the selection screen
Execute the program and check the log after
Go to WE20 and confirm the created partner profiles and inbound parameters.
Make sure the processing mode is “Trigger by background program”
Define & Configure serialization group
Once confirmed, go to below IMG node.
Modelling and Implementing Business Processes -> Master Data Distribution -> Serialization for Sending and Receiving Data -> Serialization Using Message Types -> Define Serialization Groups
Here you can see standard serialization groups provided by SAP, assigned message types and the order of processing.
In our example, we use the standard serialization group (GRP_CREMAS_ADR) to post Vendor Master & Address Master. Still you can create a custom serialization group specifically for your scenarios to serialize message types.
Go back to the transaction SALE You don’t need to do the below step as it has already been completed in a previous step.
Go to the below IMG path do define inbound processing
Modelling and Implementing Business Processes -> Master Data Distribution -> Serialization for Sending and Receiving Data -> Serialization Using Message Types -> Define Inbound Processing.
Here you define inbound processing parameters for each message type in the serialization group.
If you are going to process large number of IDOCs, you need to enable parallel processing and define number of objects (IDOCs) per process. This will help to avoid locking issues and improve performance.
PI Mapping Message Mapping
In the Message Mapping, do a multi mapping for below IDOC types o o o
ADRMAS03 CERMAS05 SERDAT01
In the SERDAT01 IDOC hardcode below
Duplicate E1TBD40 for both ADRMAS and CREMAS
Hardcode below values in the first segment (ADRMAS segment) o SERGROUP GRP_CREMAS_ADR o SEQNUMBER 1 o MESTYP ADRMAS
Hardcode below values in the second segment (CREMAS segment) o SERGROUP GRP_CREMAS_ADR o SEQNUMBER 2 o MESTYP CREMAS Make sure the serialization group and the sequence number is maintained as in the serialization group definition. See below how it appears in the IDOC
SERDAT01 IDOC segment 1
SERDAT01 IDOC segment 2
This is how the operation mapping will look like
Maintain the receiver determination as below. Set the checkbox to maintain the execution order at runtime.
Testing Generate IDOCs using PI from the source file. ADRMAS & CREMAS and the IDOCs will remain in status 64 (Based on the partner profile setup – Go to step Partner Profile Setup ) Once the SERDAT IDOC is created it will start processing message types sent along with the SERDAT01 IDOC. Object ID must match with the LIFNR value in the CREMAS05 IDOC with leading zeros.
SERDAT IDOC will do the same thing that RBDSER04 does. Message types defined in the serialization group will be processed in the order provided.
Author: Harsha Thelikorala E-Mail: mailto:
[email protected]/
[email protected] Website: www.learnsaptips.com LinkedIn: View my profile in LinkedIn
Disclaimer This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else. Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.