none
Repeat Output Segments in EDI output RRS feed

  • Question

  • Source File

    ....

    .....

    <SAC_NodeData>
    <CreateFirstSAC>100.23</CreateFirstSAC>
    <CreateSecondSAC>500.23</CreateSecondSAC>
    </SAC_NodeData>
    ...

    ...

    Destination is a 810 EDI X12 5010 Schema. As per X12 schema the SAC segment will only occur once in the output.

    My requirement needs it to occur twice. Based on a condition, if <CreateFirstSAC> and <CreateSecondSAC> are greater than or equal to '1'. I use string concat to populate fixed values into the SAC01,02,05 and 12 segments. 

    Output should have two SAC segments:
    SAC*A*IABC***10023************01
    SAC*B*IDCF***50023************01

    Any thoughts. Have to have a solution pretty fast. Appreciate your help  and thought process.

    Error in Map, when I try mapping twice.  I guess this is not a good approach and wont work.

    C:\Map_810Vendor.btm: warning btm1005: The destination node "SAC01" has 2 data input(s). The maximum number of possible data inputs to this node is 1.
    C:\Map_810Vendor.btm: warning btm1005: The destination node "SAC02" has 2 data input(s). The maximum number of possible data inputs to this node is 1.
    C:\Map_810Vendor.btm: warning btm1005: The destination node "SAC05" has 2 data input(s). The maximum number of possible data inputs to this node is 1.
    C:\Map_810Vendor.btm: warning btm1005: The destination node "SAC12" has 2 data input(s). The maximum number of possible data inputs to this node is 1.
    C:\Map_810Vendor.btm: warning btm1006: The destination node "SAC_3" has 2 logical functoid input(s). The maximum number of possible logical functoid inputs to this node is 1.

    C:\810Vendor_output.xml: error btm1048: Native serialization error: Segment level  : Segment ID - SAC : Position - 51 : [8] Segment Has Data Element Errors

    C:\810Vendor_output.xml: error btm1048: Native serialization error: Segment level  : Field Error : Segment ID - SAC : Field Position - 1 : Current value -  : [3] Node cannot repeat

    C:\810Vendor_output.xml: error btm1048: Native serialization error: Segment level  : Field Error : Segment ID - SAC : Field Position - 2 : Current value -  : [3] Node cannot repeat

    C:\810Vendor_output.xml: error btm1048: Native serialization error: Segment level  : Field Error : Segment ID - SAC : Field Position - 5 : Current value -  : [3] Node cannot repeat

    C:\810Vendor_output.xml: error btm1048: Native serialization error: Segment level  : Field Error : Segment ID - SAC : Field Position - 12 : Current value -  : [3] Node cannot repeat


    Raja


    • Edited by Sax001 Monday, April 4, 2016 4:36 AM add
    Monday, April 4, 2016 4:32 AM

Answers

  • It's really very simple.  You can have multiple SAC segments appear in the EDI, but int the Xml, SACLoop1 or SACLoop2, whichever, doesn't matter, must loop with only one SAC inside.

    This is because SAC and TXI are 1:1 but you can have as many pairs as you need, even if TXI doesn't actually appear.

    So, you Xml would look something like:

    <SACLoop1>
      <SAC>elements</SAC>
    </SACLoop1>
    <SACLoop1>
      <SAC>elements</SAC>
    </SACLoop1>


    • Proposed as answer by Angie Xu Friday, April 15, 2016 1:59 AM
    • Marked as answer by Angie Xu Friday, April 15, 2016 1:59 AM
    Monday, April 4, 2016 3:19 PM

All replies

  • Hi Raja,

    Thank you for posting on MSDN forum.

    Have you tried with SACLoop1/SACLoop2, Please use Looping functoid with SACLoop1 and your source node and confirm if it works.


    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.

    Monday, April 4, 2016 5:58 AM
  • Since SACLoop1 is within the IT1Loop1, it will repeat multiple times. The requirement is to have it like SACLoop2. Just one additional SAC. 

    Raja

    Monday, April 4, 2016 1:38 PM
  • It's really very simple.  You can have multiple SAC segments appear in the EDI, but int the Xml, SACLoop1 or SACLoop2, whichever, doesn't matter, must loop with only one SAC inside.

    This is because SAC and TXI are 1:1 but you can have as many pairs as you need, even if TXI doesn't actually appear.

    So, you Xml would look something like:

    <SACLoop1>
      <SAC>elements</SAC>
    </SACLoop1>
    <SACLoop1>
      <SAC>elements</SAC>
    </SACLoop1>


    • Proposed as answer by Angie Xu Friday, April 15, 2016 1:59 AM
    • Marked as answer by Angie Xu Friday, April 15, 2016 1:59 AM
    Monday, April 4, 2016 3:19 PM