10-25-04 10:49 PM
Some of the line data seems to be missing after using the looping functoid,
could you explain why I see this, and a way to work around this behavior?
I have an 867 EDI structure that, simplified, looks like this
Interchange
Document (many)
Transaction (many)
REF Loop (many)
QTY (many)
I am mapping the REF Loops to a database table, one of the REF loops has the
Order Number, and another other has the Agent Number. I am using the value
mapping (flattening) functoid to map correctly to the specific output schema
properties, as seen below.
-<ns0:after>
<ns0:Vet_Sales_Data BOS_Ord_Num="6638329" Dist_Agent_Code="62004" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638352" Dist_Agent_Code="62015" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638362" Dist_Agent_Code="62015" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" Dist_Agent_Code="62005" />
.
However, my ultimate goal is to create a row for each QTY, not for each
Transaction. When I map the QTY to the output, it only maps the first QTY
loop.
-<ns0:after>
<ns0:Vet_Sales_Data BOS_Ord_Num="6638329" Dist_Agent_Code="62004"
BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638352" Dist_Agent_Code="62015"
BOS_Ship_Qty="2" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638362" Dist_Agent_Code="62015"
BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" Dist_Agent_Code="62005"
BOS_Ship_Qty="1" />
.
I put the looping functoid in, where the input to the functoid is the QTY
element, and the output is the Vet_Sales_Data, so that it will create a new
row for each QTY, and replicate the other fields already generated.
However, when I do, this is the results.
-<ns0:after>
<ns0:Vet_Sales_Data BOS_Ord_Num="6638329" BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638352" BOS_Ship_Qty="2" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638362" BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638362" BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="6" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="2" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="3" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="1" />
<ns0:Vet_Sales_Data BOS_Ord_Num="6638363" BOS_Ship_Qty="1" />
.
Which is now the correct number of rows, but the Agent code is missing. It
seems to be an issue with multiple REF loops being mapped to a flat
structure, but then below it, there is a looping functoid.
If you would like to see the map, please feel free to email me back!
[ Post a follow-up to this message ]
|