Multiple iDocs in a single file RRS feed

  • Question

  • Hello, 

    I'm working on some integration to send a purchase order change file into SAP.  Everything works when we send every change as its own iDoc, or when we send all changes for a single PO in a single file, but when we try and include multiple iDocs in a single send, we get an error that it has to many elements.  The definition below is of the idocData element which indicates it can be sent more than once:

    <xs:element xmlns:q2="http://Microsoft.LobServices.Sap/2007/03/Types/Idoc/3/PORDCH03//711" minOccurs="1" maxOccurs="2147483647" name="idocData" nillable="true" type="q2:PORDCH03">

    A sample of the file:

    <?xml version="1.0"?>

    <ns0:Send xmlns:ns3="" xmlns:ns2="http://Microsoft.LobServices.Sap/2007/03/Types/Idoc/Common/" xmlns:ns1="http://Microsoft.LobServices.Sap/2007/03/Types/Idoc/3/PORDCH03//711" xmlns:ns0="http://Microsoft.LobServices.Sap/2007/03/Idoc/3/PORDCH03//711/Send">

    Thursday, April 17, 2014 12:58 PM

All replies

  • If the error is coming from SAP, then you have to take that up with their team.

    While a particular iDoc might be structured to accept multiple top level elements, there may be a reason inside SAP that it doesn't.

    Thursday, April 17, 2014 1:19 PM
  • could you validate your instance against your schema.

    in the visual studio, select your schema and set the property "input instance file name" to your sample instance.

    and then try to validate your instance as shown below.  If it does not succeed, then it means your instance does not comply with your schema definition. you should make sure it succeeds.

    Right click on the schema file and set the 

    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Thursday, April 17, 2014 1:21 PM
  • Yes, I've validated the instance and it does pass it along to SAP through biz talk with no problem.  I will try and post something in the SAP forums.



    Thursday, April 17, 2014 2:19 PM
  • I'm coming back to this one thinking that maybe it is a BT issue and not an SAP issue.  In SAP, the document is only the idocData portion, not the root "Send"; however the BT schema for this particular type does indicate that we can provide more that one idoc per send.  Is there something misconfigured that I may be missing? I believe that I can create an orchestration to break these items up and send them to SAP (which will work), but I'm trying to avoid that if possible as the XSD would seem to indicate that BT would correctly handle these extra idocData elements.
    Wednesday, April 23, 2014 12:18 PM
  • What the exact error you're getting and who is raising it?  The Adapter will bubble up all errors from the SAP client.

    I'm not aware of any circumstance where you would not use the Schema as generated by the Wizard.

    Wednesday, April 23, 2014 2:27 PM
  • The error that we're getting is in SAP:

    EDI: Syntax error in IDoc (too many repetitions of a segment)

    From my example above, if we only include a single idocData element, then everything is handled appropriately.  Its when we include 2 or more that we're getting this error.

    Wednesday, April 23, 2014 3:13 PM
  • Hi,

     Please let me know if you found any fix for this. I have landed in the same issue. I send multiple IDOC ina single send , even thou multiple IDOCs getting generated in SAP, The data is duplicated and SAP says IDOCs has syntax error.


    Thursday, May 1, 2014 11:41 PM
  • Here's the deal, I've seen this before where the Adapter will interpret something as looping but to SAP it's not or it can't.  The why and how has always been an argument between one app team and the SAP team and unfortunately, SAP always wins.

    So, basically, if SAP will not accept multiple iDocs in a single batch, you will probably have to adjust you system to accommodate that.

    If you concerned about performance, my friendly, but strong, recommendation is don't.  The SAP Adapter pools connections and I guarantee the bottle neck will be SAP, not anything on the BizTalk side.

    Thursday, May 1, 2014 11:50 PM