Question

  Asked: Dec 2 2007   2:21 AM GMT
  Asked by: Samantha777


IDoc creation function not returning Idoc number


SAP development, iDoc

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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SAP and DataManagement.

Looking for relevant SAP Whitepapers? Visit the SearchSAP.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Cfilandro  |   Mar 18 2008  6:25PM GMT

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