XI/PI: Simple IDoc Communication using SAP XI
SAP XI IDoc Adapter is by and far the most widely used adapter. This article describes its configuration on sender and receiver end along with related settings in XI and the involved SAP application systems. The configuration is fairly easy and straightforward. This article simply summarizes the different steps involved.
IDoc Adapter converts the incoming IDoc to XML and XML messages to outgoing IDoc. The IDoc adapter resides on the ABAP stack of the integration server and hence no Sender Agreement is necessary in order to setup the sender adapter. A point to note is that using IDoc adapters, we can only have asynchronous (tRFC) processing. Apart from using Runtime Workbench and transaction SXMB_MONI, IDoc messages can be monitored using transaction IDX5.
Now, let us understand the settings required in order to send an IDoc from SAP Application system to XI.
IDoc Sender Adapter Configuration
The source SAP Application system must be setup to send IDoc to the XI server. In one of my previous articles, I have described how to set up the source SAP Application system to send an outbound IDoc.
On the XI system, create a RFC destination of type R/3 connection, pointing to the source SAP Application system. Also, create a port for the source system using transaction IDX1. Mention the above created RFC destination in the IDX1 port configuration. This is required as XI uses this configuration to read the IDoc metadata from the source system. Once you have done this, your XI system is ready to receive IDocs from the source SAP system.
The metadata for an IDoc is loaded in the Integration Server when the first message for the particular IDoc is processed by the Integration Engine. You can see the IDoc metadata using the transaction IDX2. If you dont see the metadata for your IDoc in transaction IDX2, you can manually load it using the Menu options in IDX2. You need to specify the port and the IDoc type before you can import the IDoc metadata.
You can then import the IDoc definition from the source SAP system in XI Integration Repository and build your scenario on it. Then complete the Directory configuration necessary for your scenario. You don’t need to create any sender agreement as IDoc adapter resides on integration engine itself.
IDoc Receiver Adapter Configuration
Configuring IDoc Receiver Adapter is equally easy. On the XI system, create the RFC destination of type R/3 connection, pointing to target SAP Application system using transaction SM59. Create a port for the target SAP system using transaction IDX1. Mention the above created destination and port names in the communication channel used in your receiver agreement. Adjacent figure shows the configured IDoc receiver.
In the target system, you should create the partner profile for the source system using the transaction WE20. For a detailed understanding refer my post on Settings in R/3 Partner System to Receive IDocs. This post discusses the steps assuming you are using a custom IDoc. In case you are using a standard IDoc you are only required to define the source system in transaction BD54 and create a partner profile using WE20 as discussed in the same article.



leela says:
February 21st, 2008 at 1:05 pm
Hi…
The information is fine.Can u please send the IDOC to IDOC scenario by step by step procedure. And i also want the R/3 settings.
Riyaz says:
February 21st, 2008 at 1:51 pm
You can refer to this article to do the sender side configuration - set up the source SAP Application system to send an outbound IDoc. For IDoc receiver side you may want to see this article - Settings in R/3 Partner System to Receive IDocs.
This particular article (IDoc Communication using SAP XI) simply summarizes the IDoc adapter config steps for sender and receiver adapter.
If you need any specific information apart from this, or if you are facing any issues, please let me know. I will be more than happy to help.
Regards,
Riyaz
sai says:
June 13th, 2008 at 5:37 pm
Hi Riyaz,
we have 3 diff R/3 systems. Whenever any sales order creates in any of the systems that needs to captured in system 4 (r/3) for consolidation purpose. Here we don’t need to create the sales order in system4 but we required to capture this information in a Z table. What will be best possible solution for this type.
Thanks,
Sai Damerla
Riyaz says:
June 16th, 2008 at 9:43 am
Hi Sai,
You can set up IDoc to proxy scenarios. So whenever ORDERS IDoc is posted, the same can be passed on to the Z-table by means of proxy on the receiver side.
If the target system is not on WAS 640 or above, then you can create a RFC function module on the target side and use IDoc to RFC scenarios.
Regards,
Riyaz
XYZ says:
June 24th, 2008 at 5:38 am
Hello, I am new to this website as well as SAP… I am trying to learn SAP…. Once I log on to SAP GUI , when I try to open the SLD, it opens and I want to create a new product as well as a new component version but it gives the following error….
Error on page…. because of this , I am not able to go further…. What do I have to to? Any suggestions, help would be appreciated…
Thanks
Riyaz says:
June 24th, 2008 at 9:55 am
your basis administrator would be able to resolve this
XYZ says:
June 25th, 2008 at 12:08 am
When I am in SLD and try to create new product version or software component version….It opens the corresponding window and when I click on new product version it starts to open…..that is continuing forever… I mean it shows that it is opening……but not… I can’t access anything…….with that cursor …I have to close it….there is no other way….What is happening? any suggestiond?????please help….
Riyaz says:
June 25th, 2008 at 10:02 am
Try clearing your browser cache and your system cache and see if it helps…make sure that the post installation checks have been carried out properly.
Rajesh says:
August 5th, 2008 at 3:50 pm
Hey Riaz,
I have a question for u..
why is IDoc communication channel designed in a such way that the user wud have to enter both the RFC Destination and Port as the Port by itself has an RFC destination beneath it..
Riyaz says:
August 5th, 2008 at 4:31 pm
Hi Rajesh,
The RFC destination specified in IDoc adapter is used for actual data transfer (payload) whereas the port specified is used to receive the IDoc metadata. Thus, the two RFC destinations can be different and can even point to different SAP instances.
Hope this helps.
Regards,
Riyaz
Madhu Pusala says:
August 6th, 2008 at 3:18 am
Hi Riyaz,
Your articles are good and very use full. Please keep posting articles.
p says:
October 2nd, 2008 at 9:37 pm
Hi Riyaz,
I have a BPM posting IDocs to an ECC system. The msg shows success however the outbound status flag is red. Why does this happen? How can I fix it?
Riyaz says:
October 3rd, 2008 at 12:32 pm
Hi,
For errors on the outbound side refer this article. It addresses exactly the same problem you are facing.
Regards,
Riyaz
Prakash says:
November 14th, 2008 at 11:07 am
Is there a way to programmatically (either within or outside SAP) to enable and disable RFC users?
Riyaz says:
November 18th, 2008 at 9:59 am
Prakash,
You might want to try out BDC approach on trasaction SU01 to lock/unlock users.
Stanislav Studeny says:
December 10th, 2008 at 2:53 am
Hi,
I’m looking for a way how to load and XML stored in Oracle 10g XML DB. It is possible with XI/PI?
Regards,
Stanislav
Rajkumar says:
February 22nd, 2009 at 3:49 am
Hi Riyaz,
First of all I take this oppurtunity to THANK YOU for all the help you are serving for the XI developers. I’ve done all the settings as you have detailed. I created an ORDERS05 idoc in R/3 system. And the status record shows as “03″ - data passed to port O.K. But i’m not seeing the XML IDoc in idx5 in the PI system. FYI, I’ve metadata in IDX2.
Please help me to how to receive the IDOC in my PI system.
Thanks in Advance.
-raj.
Riyaz says:
February 23rd, 2009 at 9:52 pm
Raj,
Use transaction SM58 and check if the IDoc is stuck there. Put an asterisk (*) in the user name field and execute. Let me know if this helps.
Regards,
Riyaz
Rajkumar says:
February 24th, 2009 at 1:38 am
Hi Good Morning Riyaz
You are right I saw the error message in SM58. Though there was a RFC Destination(which is working fine), I created a new RFC destination did the “Test Connection” and after that only I used my new RFC to created 3 Purchase Orders and for the 3 POs i see the error messages as “Name or Password is incorrect(repeat logon).I agree I used wrong password, but how when I hit the “Test Connection” button for my New RFC, I didn’t show any error?
Raj.
Rajkumar says:
February 24th, 2009 at 4:04 am
Hi Riyaz,
Now I face another issue, As I said in my first mail, I’ve setup everything in my tartget system(B). Today again i created an PO, this time i see a new message in sm58, it says “No service for System B, client 010 in Intergration”
I checked my target system(B) which is a PI system. everything is fine. I don’t know why i’m facing this RFC issue at my source system.
-raj
Rajkumar says:
February 24th, 2009 at 3:38 pm
Hi Riyaz, Sorry for the confusion. In my source system(A) when i create purchase order, i saw the error message in sm58 and the error message is ” No Service for A, Client 010 in Interg”
My source system is ‘A’ and my target system is ‘B” which is PI.
Raj..
Raj says:
February 24th, 2009 at 10:31 pm
Hi Riyaz, in continuation with the above mail, since morning i keep thinking, now this is what i understood. I looked at the error message in sm58 again (No service for system A, client 010 in Integration Directory). This indicates some kind of entry is needed on the PI sandbox system (B) in the integration directory.
Raj.
Riyaz says:
February 28th, 2009 at 2:32 am
Hi,
Make sure that you have Business systems correctly defined in PI SLD. Also make sure that you have a Logical System name specified for the corresponding Business system in Integration Directory. For this you can go to menu options ‘Service–>Adapter Specific Identifiers’ for your Business system.
Raj says:
March 3rd, 2009 at 12:30 am
Hi Riyaz, finally it worked now.
Raj.
Petr Hodbod says:
March 5th, 2009 at 3:44 pm
Hi Riyaz,
First thank you for your posts. I’d like to ask you 1 tricky question. We have on 1 Netweaver server XI and BW systems.
Now I have 1 R3D system which is sending IDOC to BW system and XI. We’had copied client 200 to 210 and the old one is deleted.
I have 2 ports A0000026 and A00000022 Port A…22 is used for XI and port A…26 for BI.
Now Xi is working with specific IDOCs correctly, but when I send IDOC to BI I have got message “No service …. in Integration Directory” But it is true, because this IDOC didnot go into XI.
Please can you advice me where to look? In SLD it looks correctly.
Thanks you very much
Petr
Petr Hodbod says:
March 17th, 2009 at 2:28 pm
Hi, I have found solution for this problem. in SAP NW exist transaction IDX_SELECT_IDOCTYP_WITHOUT_IS which disable sending IDOC into XI if XI and BI is on the same machine.
I hope this helps others
Petr
Donald says:
March 17th, 2009 at 6:32 pm
Response to Petr Hodbod’s message:
In our case, BI on other machine is receiving IDOC from R3, after XI installed on the same machine of R3, BI get error“No service …. in Integration Directory”.
Should I run the report IDX_SELECT_IDOCTYP_WITHOUT_IS at BI in this case?
Thanks.
Adnan Maqbool says:
April 20th, 2009 at 3:46 pm
Dear Riyaz
While creating IDOC Metadata on T-Code IDX2 on XI I am getting error you are not authorized to logonon target system.
On source system while sending data to XI i am getting this error on SM58
No Service for SAP SYSTEM.. client 500 in Integration Direcotry.
Riyaz says:
April 20th, 2009 at 5:20 pm
Adnan,
Please check the RFC destinations created on XI and on source SAP system pointing to each other. I guess the RFC destinations are in error.
Adnan Maqbool says:
April 21st, 2009 at 8:11 am
Dear Riyaz
Problem is resolved issue was with password , it was required in capital letters.
But the issue
On source system while sending data to XI i am getting this error on SM58
No Service for SAP SYSTEM.. client 500 in Integration Direcotry is still there.
I think its releated to Idoc Adapter in ID.
Riyaz says:
April 21st, 2009 at 9:54 pm
You can check the IDoc adapter metadata in IDX2. Try deleting and reimporting IDoc metadata. Also check if the logical system name of the business system is exactly same in SLD as well as in source SAP system and in the ID.
Kiran says:
May 3rd, 2009 at 10:24 am
Hi Riyaz,
You step-by step ALE/IDOc article is very helpfule. It helped me alot. Thanks for good work. Can you tell me what will be step if we have standard Idoc and message type (like in Hr benefits) in XI enviorment? I would really appreciate your help.
Riyaz says:
May 3rd, 2009 at 9:19 pm
Kiran, Steps in XI remain the same whether it is a standard or custom IDoc. Difference would be in ERP system, where you wont need to create IDoc segment in case of standard IDoc as those are already defined.
Deepika says:
June 17th, 2009 at 5:55 pm
Hi Riyaz,
Nice post. Thanks. it helped a lot. i have few doubts. you have told that if we are using the standard IDOC we have to configure partner profile and logical system. i am confused if we have to configure them in XI/PI or SAP system. Kindly let me know. Also let me know what are the details to be given while creating partner profile and logical systems
Regards
Deepika
Riyaz says:
June 17th, 2009 at 7:26 pm
You need to do it in SAP system. Follow this link.
bala says:
August 27th, 2009 at 7:54 am
Hi Riyaz,
Your articles are very useful.
I want to extract data from Material Master (MARA) and sent it to target system using XI.
Can you give the step by step procedure.
Thanks.
Bala
Riyaz says:
August 27th, 2009 at 6:44 pm
You can use MATMAS IDoc with IDoc adapter on sender side and appropriate receiver adapter on the target side as per your target system.
sushil says:
August 28th, 2009 at 1:43 pm
Please suggest,
As I have a requirement at my hand wherein I need to send something to .Net application and need to accept something from .net application, How can I establish this connection between sap and .net application step by step……any suggestion or input would be highly appreciated…………..
Riyaz says:
August 28th, 2009 at 2:39 pm
You might want to make use of web services. Have a look at web services articles on this website. You may want to explore on similar lines.
PS: For quicker respone, use forums. Forums are visited more frequently and regularly than individual articles.
sushil says:
August 28th, 2009 at 2:55 pm
As usual Riyaz…….thanx for that swift responsse…
but can you giv me a step by step scenerio to establish this connection to and from sap to .Net application…….this is basically meant for BAPIs…..
Again a swift reply of great help…………
Meantime I am going through given by you……
thanx once again……….
sushil says:
August 28th, 2009 at 3:11 pm
Let me clarify the scenario little bit………
the integration is with .net becoz while saving any transactional data like sales order data from transaction VA02 or VA01 I want to send the entire sales order in xml format to the .net application as the guys working on that application are going to store some additional data that is not there in SAP. Every time a sales order is created or changed that sales order related information should get converted into the xml format and be dumped to their system…..
Please suggest the best possible solution to approach this problem……
and some detailed solution would be of great help as its on high priority…….
Riyaz says:
August 29th, 2009 at 1:20 pm
For sending sales order data you can setup configuration such that ORDERS IDoc is generated and sent to PI. This IDoc can be converted to XML stracture in PI as per your requirement and can be transferred to .net application. On the .net application, you could either use a web service as I suggested earlier with the help of SOAP adapter or even simpler would be using a file adapter to put the file on the .net application server or a shared/FTP location accessible to the .net application. I hope this answers your query.
Sushil says:
August 31st, 2009 at 11:05 am
Your suggestion more or less answers my query…….but during my quest on net for the solution I also bumped into this ‘DCOM Connector’…….Just wanted to ask if that could also be one potential solution and also a better one than what u suggested me in your last reply…….
If so please give me an insight in DCOM Connector as well…
Thanks in advance for help……….
Riyaz says:
August 31st, 2009 at 7:24 pm
Well, I am not aware of DCOM Connector, so may not be able to give my inputs on this. However my solution can be implemented using just PI without need of additional components.
Sushil says:
August 31st, 2009 at 7:29 pm
Thanks Riyaz…..you inputs were of great help……..
Adnan Maqbool says:
September 8th, 2009 at 5:52 am
Dear Riaz
I have implemented the above scenario for R3 to R3 communication and its working perfectly. But what changes will be required in case of R3 to Bank Scenario. I do not have any knowledge about Bank Logical System and Client.
Idoc is reaching to XI but I am not able to send it to bank.
Adnan Maqbool says:
September 9th, 2009 at 6:07 am
Make sure that you have Business systems correctly defined in PI SLD. Also make sure that you have a Logical System name specified for the corresponding Business system in Integration Directory. For this you can go to menu options ‘Service–>Adapter Specific Identifiers’ for your Business system.
Dear Riaz
Other then my previous post how would I set adapter setting for the bank because i don’t know the Logical System Name and Client of Bank end. Please write a blog where the receiving end is unknown.
ved thakur says:
December 15th, 2009 at 4:50 pm
Dear Riyaz and friends,
i am totally new to ale/idoc concept
friends my requirement is i have to send data from sap to .net connector
what should be the approach and i have to use the idoc WBBDLD01 (assortmrnt list)
what are the approach guys.
please help