AnsweredAssumed Answered

Repeating EDI segment causes extra output data

Question asked by arobinson on Jan 20, 2017
Latest reply on Jan 24, 2017 by arobinson

I have a custom EDI 945 profile that is mapped to an XML file that doesn't have repeating child elements.

 

Everything works fine until the final set of lines (SN/TRNU) is mapped. At that point I end up with 4 sets of <CustomerOrderLine> records instead of just 2 for each pair of SN/TRNU.

 

Example EDI data

 

2020CC2 2 0 EA VN350500 LP350500
2040WHSATLANTA
2040RIN0007020729
2040RIL01000
2040PSX1
2040DIX1395998
2040SN SerialSN7311
2040TRNTrackiTRNU7311
2040SN SerialSN7321
2040TRNTrackiTRNU7321

 

Example XML output

 

<CustomerOrderLine>
<RIDN>0000620527</RIDN>
<RIDL>00100</RIDL>
<PLSX>1</PLSX>
<DLIX>1396005</DLIX>
<OEND>0</OEND>
<PACT>BOX</PACT>
<SSCC>Tracki641TRNU1</SSCC>
<ISMD>0</ISMD>
<BREF>Serial641SN1</BREF>
</CustomerOrderLine>

 

Examples of the remaining records (removed most elements as those stay the same)

 

<SSCC>Tracki641TRNU2</SSCC>
<ISMD>0</ISMD>
<BREF>Serial641SN1</BREF>

</CustomerOrderLine>

 

<SSCC>Tracki641TRNU1</SSCC>
<ISMD>0</ISMD>
<BREF>Serial641SN2</BREF>

</CustomerOrderLine>

 

<SSCC>Tracki641TRNU2</SSCC>
<ISMD>0</ISMD>
<BREF>Serial641SN2</BREF>

 

Has anyone run into this and found a reliable way to prevent the extraneous combinations of data from being generated?

 

I've attempted adding loops to the EDI profile and manually changing the "2040" segment for those last few lines to something else for testing (and adding them to their own loop as well).  I was thinking out using an intermediate XML or flat file map to get the data lined up, but those still experience issue with the extra data.

Outcomes