Skip to Content
Author's profile photo Mainak Aich

Sending a IDOC to the same client in a SAP system

Sometimes we have a requirement to send the IDOC to the same client of a SAP system. This is mainly required in testing, when the destination system or any client has not set up yet and available to use.That means, e.g. if an outbound IDOC is generated from client 270 of sap server ID1, then the inbound IDOC will be coming to the same client 270 of server ID1. To achieve this, no change is required in the program for sending IDOC and receiving IDOC but we need to implement some configuration steps which I am showing below –

Step 1-Create logical system for sender and receiver

  Login to client ID1/270 and execute transaction code SALE and the following screen is displayed. Please choose “Define Logical System” as shown below –


Most of the time, the logical system for a particular client is already configured by BASIS, i.e. if the client is ID1/270, then a logical system named ID1CLNT270 will be there automatically. We will use this logical system as sender. Please create a new logical system called ID1270RCV that will be used as receiver.


Step 2- Create port

Execute transaction code WE21 and create a new port as transactional RFC like below. Beside please input RFC destination as the system ID which is ID1 in this case. In every system normally a RFC destination with the name of system ID is available under connection type 3(ABAP connection). And actually this is the trick behind to achieve this requirement as this RFC destination is actually is pointing to the same system/client.


Step 3- Create partner profile

Execute transaction code WE20 and create the following partners of type LS (logical system).

  1. Create partner ID1270RCV as a receiver. Please note here the name chosen is same as the logical system name.


Enter the port created in step2 in the outbound message configuration.


2. As we are going to receive the IDOC in the same client, so we need to create another partner ID1CLNT270 which was the sender. The process to create this will be same and here we need to enter details for the inbound message configuration. This can be done later after defining process code.


Step 4-Create distribution model

Execute transaction BD64 and go to change mode. Then create a new model view and give the sender, receiver and message type. Here I have created a model view ZACCDOC for that.


After that we need to do the necessary configuration for inbound IDOC. In short, we need to perform the following steps. I am not going into this in detail as this is normal steps that are followed in any inbound IDOC configuration.


And we are done! Once the program to trigger the outbound IDOC is executed, automatically the inbound IDOC gets created in the same client that gets the immediate next IDOC number. Here in the following screen, after the outbound IDOC 1023 is generated the inbound IDOC 1024 has been created.


Assigned tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Mainak,

      Can you please explain how this is different from the "normal" config? AFAIK, you have to follow the same steps anyway.


      Author's profile photo Mainak Aich
      Mainak Aich
      Blog Post Author

      Hello Suhas,

      You are right that there is nothing much difference to the normal configuration but the only point where we need to use the right destination. But I still thought to show the E2E process so that it is helpful for a beginner in IDOC to complete the configuration.


      Author's profile photo Arindam Basu
      Arindam Basu

      Hi Mainak,

      Thanks for your good document !

      I was trying to replicate the scenario as you mentioned in IDES with slight modification, instead of Partner type : LS ( as you nicely described), I tried to design as Partner type KU ( Customer). I was partly successful and Outbound IDOC successfully triggered but for Inbound IDOC it's showing Status as 56 and somehow I can't get to hit the right partner as I created through WE20. It's going to hit another LS wrongly...

      Please do share if you have any thoughts and so that I can reach to right solution.

      Author's profile photo Mainak Aich
      Mainak Aich

      Hello Arindam,

      Thanks that you found my document useful.

      Please check in your receiver partner profile, are you passing the same message type as you are mentioning in your sender parter profile? Technically, when you trigger the outbound IDOC through master IDOC distribute, it finds the sender partner and then the port provided in it. Then from the port, it resolves the logical destination and then the IDOC is sent to that destination.

      Now, in the receiver system(here it is the same), the framework tries to see the inbound partner which has the same message type of this IDOC message type and then executes the process code. I think in this step, the framework is finding another partner having the same message type other than created by you and it is failing. Please check on that part.



      <removed email address>

      Author's profile photo raghavendra kumar
      raghavendra kumar

      Hi Mainak,

      Thanks for a Detail explanation where even Beginners can easily understand.

      I do have similar requirement where i am sending out Outbound intern it will convert as inbound to same client but as said by Arinadam i am also encountered with similar error "Status as 56 " where i am using same message type in both sending and receiving side and this Message type was newly created by for this scenario and when i check the partner in table EDP21  and entry exists with message type and still i am encounter with same error "EDI: Partner profile inbound not available".

      Can you please help me with this error, i checked all the possibilites.

      Author's profile photo Joana Carolas
      Joana Carolas


      I did this configuration for message type FIDCC2 (FI IDOC) and I don't need to send the FI document for any external system. I only need to create an IDOC in some special situations. I already implemented the BADI IDOC_CREATION_CHECK and now I could restrict the creation of a FI IDOC but when I create a FI invoice, the Clearing Document field is filled with ‘ALE-extern’ and I don't undestand why because the sender and the receiver are the same client. I don't know if anything in the FI documents is modified when I 'activate' this FI IDOC.

      How can I ensure that the FI IDOC is only created without modifying anything else in the FI document posting ?

      Best regards,