Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Posting and receiving the IDOC to same system(client)

Former Member

hi friends

we have got a scenario were we are creating an inbound process code and in which one more inbound process code, the thing is we are unable to archieve an IDOC while we are using like this, so we planned to posting an IDOC from same system and then while receiving the inbound FM which is called inside will come into act.

can anybody give me the steps where i can post and receive the IDOC from and to same system.

Thanks in advance



Former Member
0 Kudos

solved by myself

0 Kudos


can u provide some input on this and how it was handled?



Former Member

The steps to send and receive an IDoc in the same system are as follows:

u2022 Create a Dummy Logical System.

 Goto T-Code SALE-> sending and Receiving Systems -> Logical Systems -> New entries. Enter SYSID_CLNT, but this one is Dummy so use the first two characters of the SYSID and prefix 'D' then underscore and then the Client number.

E.g., If ERP_100 is the logical system of the R/3, then create ERD_100 as the dummy system.

u2022 Create Port for the Original System, (ERP_100)

 Goto WE21 and select Transactional Port and press the Create button. Name the Port as "SAP" concatenated with the SYSID in our example it would be SAPERP Select the appropriate version and enter the RFC destination of the system that you are working on in this case it will be 'ERP'.

u2022 Create Partner Profile in partner type LS:

 Receiver Side (Outbound to): In Partner type LS name ERD_100create the Outbound Parameters, give the Message type, Receiver Port same as the port we created in step 2. Enter the Basic type.

 Sender Side (Inbound from): In partner type LS name ERP_100 create the Inbound Parameters, give the appropriate message type and the process code.

u2022 Now create the stand alone program to send the IDoc:

 The program will at some point calls the MASTER_IDOC_DISTRIBUTE function module. When you pass the EDIDC structure it will be populated as follows:

i_edidc-mestyp = message type.

i_edidc-idoctp = basic type.

i_edidc-rcvprt = 'LS'.

CONCATENATE 'SAP' sy-sysid INTO l_port.

i_edidc-RCVPOR = l_port.

i_edidc-rcvprn = 'ERD_000'.

CONCATENATE sy-sysid '_' sy-mandt INTO l_sndprn.

i_edidc-SNDPRN = l_sndprn.

i_edidc-sndprt = 'LS'.

i_edidc-sndpor = l_port.

u2022 Observe that the Sender port and the receiver port is the same, this does the trick. The outbound Idoc is sent on the port SAPERP with the Sender as ERP_100 and receiver as ERD_100 and then the Inbound IDoc is also sent to the same port SAPERP with the Sender as ERP_100 and receiver as ERD_10.