Map Setup

You must declare an index because Temp_LineItem is a repeating structure, and the map must write the data consecutively to the repeating iterations of Temp_LineItem to verify that no data is missed when the Output segment is created during translation.

For the Input Level (PETTEST_INVOICE) On-Begin extended rules, you declared and initialized an index, as the following example indicates:


Integer X;
X = 1;

Also, you added the following an On-End extended rule for the LineItem element:


If $QuantityShipped.#QuantityShipped > 0 Then
Begin
   $Temp_LineNum[X].#Temp_LineNum = 
$AssignedIdentification.#AssignedIdentification;
   $Temp_Shipped[X].#Temp_Shipped = $QuantityShipped.#QuantityShipped;
   $Temp_Ordered[X].#Temp_Ordered = $QuantityOrdered.#QuantityOrdered;
   $Temp_UOM[X].#Temp_UOM = $UOM.#UOM;
   $Temp_UnitPrice[X].#Temp_UnitPrice = $UnitPrice.#UnitPrice;
   $Temp_ProductCode[X].#Temp_ProductCode = $ProductCode.#ProductCode;
   $Temp_UPCCode[X].#Temp_UPCCode = $UPCCode.#UPCCode;
   $Temp_Description[X].#Temp_Description = $ItemDescription.#ItemDescription;
   $Temp_TermsType[X].#Temp_TermsType = $TermsTypeCode.#TermsTypeCode;
   $Temp_TermsDis[X].#Temp_TermsDis = 
$TermsDiscountPercent.#TermsDiscountPercent;
   X = X + 1;
End

After you compile this extended rule, you receive the following compilation errors:

ERROR 2002, Line 3: insufficient indices to access group "Temp_LineNum"
ERROR 2002, Line 4: insufficient indices to access group "Temp_Shipped"
ERROR 2002, Line 5: insufficient indices to access group "Temp_Ordered"