25 pts.
 IDoc creation function not returning Idoc number
Hi. I am working on the requirement to send data from SAP to non-SAP system and I using the IDoc creation function 'MASTER_IDOC_DISTRIBUTE'. I am having issue with it. It is not returning Idoc numbers that it created even though it has in Table parameter COMMUNICATION_IDOC_CONTROL = I_EDIDC. I checked everything and it looks fine. I do not know what is missing. Can anyone help how to get Idoc numbers. Will it send one Idoc number or multiple? Will reward point who can help me solve the issue. Samantha777

Software/Hardware used:
ASKED: December 2, 2007  2:21 AM
UPDATED: March 18, 2008  6:25 PM

Answer Wiki:
For as long as I have used IDoc function from an external system they have never returned the IDoc number. I once customised the function INBOUND_IDOC_PROCESS as it literally doesn't copy the IDoc number into the original IDOC_CONTROL structure and that is all. If you debug the function it has the newly created IDoc number inside the function module and then proceeds to do nothing with it. That has been happening since at least SAP 3.0 and does not surprise me that it was never fixed. Basically unless you copy the FM and add in the code to copy the IDoc number to the structure you will never get the number back in the external system. In the case of the function INBOUND_IDOC_PROCESS I simply updated the passed in control record in the table with the resulting IDoc number from the function call IDOC_CREATE_ON_DATABASE. This FM was easier to copy and modify as the work is done in the FMs called inside and the final call to IDOC_CREATE_ON_DATABASE. You'll find the FM you mention calls the same function eventually, so you may wish to look at using this instead. Sorry for the bad news. Cheers, Jason
Last Wiki Answer Submitted:  March 18, 2008  12:31 am  by  Lakiwi   30 pts.
All Answer Wiki Contributors:  Lakiwi   30 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

We may have had a similiar issue in the past. When our middleware wanted to create an IDOC, they were calling IDOC_INBOUND_ASYNCHRONOUS. This had the same problem of not returning the IDOC number. However, you can instead call IDOC_INBOUND_SINGLE and it does return an IDOC number. This was inbound (into SAP)…not sure it can help you if you are trying to create outbound IDOCs…….but just in case it gives you any ideas.
Chris

 180 pts.