Let’s look at how to set the iDoc Control Record in iDoc receiver scenario in SAP PI/PO single stack version. Due to evolution of SAP XI/PI/PO architecture, iDoc communications method as well as configurution of iDoc adapter and iDoc Control Records have changed.
In this example we will look at how to configure or set the iDoc Control record in the receiver iDoc_AAE adapter in Process Orchestration PO 7.5 single stack system. Depending on the Control Record element, method of assigning the value to the element differs.
Let’s first look at what iDoc control record fields are mandatory, then at the different ways to set these mandatory iDoc control record fields with an example.
Mandatory iDoc Control Record Fields:
- TABNAM – Table Name
- DIRECT – Direction
- IDOCTYP – iDoc Type
- MESTYP – iDoc Message Type
- SNDPOR – Sender Port
- SNDPRT – Sender Partner Type
- SNDPRN – Sender Partner Number
- RCVPOR – Receiver Port
- RCVPRN – Receiver Partner Number
SAP Versions used in the illustration:
- SAP S4 HANA Fashion 1709
Two Main Methods to Set iDoc Control Record Parameters:
-
Applying Control Record from Payload.
If this configuration is activated at the receiver iDoc_AAE adapter Communication Channel, you can use the mapping program to set values to different iDoc Control Record header fields. You can implement your own custom logic to determine each iDoc Control Record field in Message Mapping.
-
Applying Control Record from Payload Deactivated.
When ‘Apply Control Records from Payload’ is deactivated at the receiver iDoc_AAE adapter communication channel, iDoc Control Records are set at runtime by combination of System Landscape Directory (SLD) configuration, Integration Directory (ID) configuration of the integration scenario and Interface name.
XML File to iDoc Interface to Demonstrate iDoc Control Record Assignment.
In the example iDoc Control Records will be set with ‘Apply Control Records from Payload’ option deactivated in the receiver iDoc_AAE communication channel.
Scenario: Let’s assume you have third party HR system which sends employee details in a XML format which triggers a custom iDoc Type in SAP. Third party HR system is represented as a Business Component in SAP PI/PO Integration Directory under name ‘HR_System’. Receiver SAP Business System’s name is ‘AFX’ and logical system’s name is ‘AFXCLNT200’. How you can access Logical System’s name under Adapter Specific Message Attributes (ASMA) is shown on screen shots below.
You should already have the HR system registered in SAP back end system as ‘TESTHR’. Partner profile name in SAP system corresponds to the Logical System Name of the Business Component HR_System in PI/PO Integration Directory.
Disable or Map Blank Values to Mandatory iDoc Control Record Fields in Target Structure.
In the message mapping either disable or map the mandatory Control Record parameters with a blank value, else you cannot activate the message mapping program. All required iDoc Control Record fields of the target structure should be mapped or disabled in the target structure.
Mandatory iDoc Control Records Disabled
Configure Receiver iDoc Communication Channel.
Deactivate ‘ Apply Control Records from Payload’ in the receiver iDoc_AAE adapter Communication Channel.
How does iDoc_AAE Receiver Adapter Determine each Mandatory iDoc Control Record Parameter?
- TABNAM – Table Name
This is set as a constant value ‘EDI_DC40’.
- DIRECT – Direction
Constant value ‘1’.
- MESTYP – iDoc Message Type
This is determined from the Inbound Service Interface name, which is the iDoc Interface name in format <Message Type>.<iDoc Type>. In this example Message type is ‘ZMSG_TY_EMPLOYEE_DETAIL’.
Therefore the MESTYP is set as ‘ZMSG_TY_EMPLOYEE_DETAIL’.
- IDOCTYP – iDoc Type
Similar to MESTYP (Message Type), IDOCTYP (iDoc Type) is also determined from the Inbound iDoc Interface Name. In the example iDoc Type is ‘ZEMPLOYEE_DETAIL’.
IDOCTYP set as ‘ZEMPLOYEE_DETAIL’.
- SNDPOR – Sender Port
Constant SAP+SYSID of the Integration Server is assigned to SNDPOR (Sender Port). SYSID in of SAP backend in this scenario is AFX. Therefore, SNDPOR set as SAPAFX.
- SNDPRT – Sender Partner Type
Constant value ‘LS’.
- SNDPRN – Sender Partner Number
Sender Business Component’s Adapter Specific Message Attribute (ASMA) Logical System name. In this example Logical System Name of the third party ‘HR_System’ Business Component is configured as ‘TESTHR’.
‘TESTHR’ should be the partner profile name in SAP for third party HR system.
Register corresponding Logical System Partner Profile for HR system in SAP backend using we20. Configure inbound parameters to allow communication of custom iDoc Type with the external system.
- RCVPOR – Receiver Port
Determined from the port of the receiver iDoc_AAE adapter. We connect to SAP system from PI/PO using a RFC destination and iDoc_AAE adapter protocol tRFC.
- RCVPRN – Receiver Partner Number
This is an SAP back end, and RCVPRN is set from the Business System’s Logical System name under Adapter Specific Message Attributes (ASMA).
Test XML to iDoc Interface.
Send a test message to check if iDoc Control Record fields are populated in target SAP system correctly. Go to we02 or any other iDoc monitoring transaction in SAP to view the created iDoc.
How to Override iDoc Control Record Parameters?
You can override these parameters using ‘Override iDoc Control Headers’ option in receiver iDoc communication channel. Specify the name of the Control Record field and Corresponding value to override the parameters.
If you activate ‘Override iDoc Control Headers’ in receiver iDoc_AAE Communication Channel and assign values to Control Record fields as above, automatically determined values would be replaced by configuration values. In this example, Sender Partner Number (SNDPRN) will be populated in the iDoc as 100012 instead of TESTHR. Also Sender Partner Type (SNDPART) value LS will be overwritten as KU in the iDoc.
Override Only SNDPRN from Payload.
If you just want to override the sender partner related control records such as SNDPRN, SNDPRT, etc. from the payload, activate ‘Apply Sender from Payload’ in receiver communication channel. Now you can set sender related parameters from mapping program.
Set Receiver RCVPRN from Payload.
Similarly receiver related Control Records can be overwritten by mapping program (payload) by activating ‘Apply Receiver from Payload’.
Set Optional iDoc Control Parameters from Mapping Program.
Use the mapping program to set values to other optional iDoc Control Record fields.
If you have any questions about iDoc Control Record determination in SAP PI/PO receiver iDoc_AAE adapter, please leave a comment below.
Nice Blog..Keep posting. 🙂
Thank you Sirisha!
What’s special about the IDOC the inbound configuration?
I here has been an error in WE02
Hi Star,
Make sure to maintain all configuration shown in PI and ECC side.
Send error log in detail.
Regards,
Isuru
Hello,
It’s a very nice blog
please can you share your contact details
Thanks/Regards,
Darshan Thakar
Hi Darshan,
You can contact me through [email protected]. Do not forget to subscribe to my email updates.
Cheers!
Hi Fernando
Can we use parameterized mapping for control record mapping
Hi Abhi,
Of-cause! You can use a parametarized mapping to import values to the message mapping program. Check my previous post of parametarized message mapping.
Cheers!
Isuru
It’s good and it’s use full for me
Glad to hear that! Thank you.
Cheers!
Isuru
how to track ECC inbound IDOC number in SAP PO.
Hi Sumanth,
You can find the the iDoc information of an inbound message from the table EDIDC. Find the PO message ID from message monitor then, select the reacord where EDIDC-ARCKEY equals to the PO message ID. Use to transaction SE16N to access EDIDC table records in SAP ECC.
Cheers!
Isuru
Hi
I just came across this wonderful blog and I have a question.
Do we need to create a partner profile for the PO system in the SAP sender system, if we we have a SAP sender system.
BR
Hi Samer,
You have to create the partner profile in the SAP sender system 🙂
Cheers!
Isuru
Hi Isru
Thanks for your reply
Just to be sure, if we have SAP — > PO —> Third party system.
In SAP , do we have to create a partner profile for both PO and Third party system.
BR
Hi Isru,
I’ve the same question as above from Samer Masoud.
Very useful, Fernando! Thanks!
Appreciate your feedback! Thank you, Pablo!