none
DATAHEADERCOLUMN_SEGNUM in SAP idoc schema generated in Biztalk RRS feed

  • Question

  • Hi,

    can anyone please let me know how to go about sending in the DATAHEADERCOLUMN_SEGNUM filed value from Biztalk to SAP? This filed exists in each of the segments in IDOC schema generated in Biztalk and we need to pass in this value while sending the IDOC's from Biztalk to SAP if not then we getting the error in SAP system as below. 

    " EDI: Syntax error in IDoc (segment cannot be identified).

    To avoid this error SAP team asked to send in the DATAHEADERCOLUMN_SEGNUM field with segment no's as 1, 2 3 etc based on how segments are in SAP system which worked fine wherever biztalk is sending a file with each segments appearing once. But when a segment occurs multiples then the sequence number being passed failing and then its erroring out in SAP.

    Can anyone please suggest how to go dynamically increment to pass on value in   DATAHEADERCOLUMN_SEGNUM field so that the repeating records are as well assigned the correct segment number. 

    Thursday, October 27, 2016 3:11 PM

All replies

  • Hi,

    Try checking the IDoc messege : DATAHEADERCOLUMN_SEGNUM  carefully for each property defined in Biztalk iDoc schema . There are some restictions.element properties only checked at SAP endpoint but BizTalk will not do that. 

    As a long term solution you may want to contemplate introducing a BizTalk map which enforces each restriction/property match on the actual payload as displayed in the schema properties.

    Check this Article


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.


    Thursday, October 27, 2016 3:23 PM
  • Hi Pushpendra,

    Thanks for your response. I did check for the properties but there is nothing in there. I cant find anything specific. Can you please let me know how to go about this? I am currently writing code in scripting functoid to increment this no for every segment appearing in a message which is working fine. But when the second message comes in instead of resetting back the SegNum to starting from 1 it's actually continuing to increment and passing the values which is again erroring out.

    like for first message it assigns for each segments  1, 2 , 3 and so on for all segments lets say last segment number is 12 which is fine but when second message comes in then the segmentno is passed as continuation from last message segment number i.e starting from 13, 14, 15 and so on instead of resetting again from 1, 2 3 and so on. 

    Thursday, October 27, 2016 3:54 PM
  • Hi,

    To that I would suggest you create one more scripting functoid  and connect it to the last node on the destination of your map. Now reset the value of your variable in the new scripting functoid.  

    Also generate the map XSLT(validate map) after making this change and see if the variable resetting is done towards the end of XSLT


    Regards Pushpendra Singh : Please mark the reply as answer or vote it up, as deemed fit.

    Thursday, October 27, 2016 4:39 PM