none
BizTalk Sever 2010 - SAP idoc adapter - Incorrect segnum string length for segnum over 100 RRS feed

  • Question

  • I am getting this error when BizTalk is submitting some idocs to SAP:

    Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 14  Field: DATAHEADERCOLUMN_SEGNUM Allowed value: 12

    I took a look at the suspend idoc in memory and I found that the segnum is incrementing sequentially like this: <ns1:DATAHEADERCOLUMN_SEGNUM>000001</ns1:DATAHEADERCOLUMN_SEGNUM>

    ...

    <ns1:DATAHEADERCOLUMN_SEGNUM>000099</ns1:DATAHEADERCOLUMN_SEGNUM>

    <ns1:DATAHEADERCOLUMN_SEGNUM>0000100</ns1:DATAHEADERCOLUMN_SEGNUM>

    Notice that the number of leading zeros is correct for 100 and less, but after 100 the number of leading zeros goes to 7, which is one larger than accepted by SAP. Is there a setting that can change this behavior? Is this bug, is there an existing hot fix to address this?

    Thanks very much.

    Monday, November 16, 2015 9:54 PM

Answers

  • Hi,

    You should check the IDoc-XML carefully. Since the generated XSD itself does not necessarily check for maxLength (it might only define xsd:string), the IDoc-XML might successfully validate against the schema.
    However, during run-time the WCF SAP adapter checks the field length against the IDoc specification and fails
    You can find the real field length actually in the flat file attribute pos_length.

    Also keep in mind that the length value is 12. The exception message says that a length of 14 , but actually only 12 is allowed.

    Thanks

    Abhishek


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


    Tuesday, November 17, 2015 5:14 AM

All replies

  • Hi Kevin,

    Thank you for posting in MSDN forum.

    Please have a look into below related thread for some help, as per thread,

    first check the restrictions given in the schema and then you should  modifing your instance XML to comply with the restrictions given in the schema,

    https://social.msdn.microsoft.com/Forums/en-US/49e138be-21b9-4f2d-8336-5b47a191edaa/send-idoc-from-biztalk-to-sap

    https://social.msdn.microsoft.com/Forums/en-US/66ba923a-11c7-4e98-a797-e0f1361ef231/microsoftservicemodelchannelscommonxmlreaderparsingexception-the-length-of-the-value-for-the?forum=biztalkr2adapters


    Thanks,

    If my reply is helpful please mark as Answer or vote as Helpful.

    My blog | Twitter | LinkedIn

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Tuesday, November 17, 2015 3:36 AM
  • Hi,

    Past couple of months I have worked extensively on integration projects around SAP. During chain tests I like you ran into this types of errors from SAP. In the projects we dealt with these in our maps by restricting the length of values to SAP value/restrictions. This can be cumbersome from time to time. Eventually a good understanding of SAP value/restrictions of each message going into SAP is key. Analysis of SAP generated schema combined with mapping can prevent these types occurring in test, acceptance and eventually in production.

    HTH

    Regards,

    Steef-Jan Wiggers
    MVP & MCTS BizTalk Server 
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk

    Tuesday, November 17, 2015 4:03 AM
    Moderator
  • Hi,

    You should check the IDoc-XML carefully. Since the generated XSD itself does not necessarily check for maxLength (it might only define xsd:string), the IDoc-XML might successfully validate against the schema.
    However, during run-time the WCF SAP adapter checks the field length against the IDoc specification and fails
    You can find the real field length actually in the flat file attribute pos_length.

    Also keep in mind that the length value is 12. The exception message says that a length of 14 , but actually only 12 is allowed.

    Thanks

    Abhishek


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


    Tuesday, November 17, 2015 5:14 AM