In this example, you want to count the quantity ordered
for each line item and load the total quantity in the CTT02 (Hash
Total) element.
Use this procedure to count the quantity ordered and generate
a hash total for an outbound ANSI X12 purchase order.
- Double-click the P0102 element (in the P01 segment in the
P01 group). This is the element that you typically use to count the
line items.
The system displays the Element Properties
dialog box.
- Select the Standard Rule tab.
- From the standard rule list, select Use Accumulator.
- Click New.
The
system displays the Edit Accumulator Entry dialog box to create a
new calculation for this element.
- From the Primary Accumulator list, select 1.
- In the Name box, type Total Quantity.
- From the First list, select Hash Sum in Primary.
This is the first operation that the system performs. This specifies
that the system will add the numeric value of the PO102 element to
the contents of the Primary Accumulator.
- Click OK to add the accumulator.
- Click OK on the Element Properties
dialog box to add the standard rule to the P0102 element.
- Double-click the CTT02 element (in the CTT segment). This
is the element that typically contains the total quantity of the purchase
order.
The system displays the Element Properties
dialog box.
- Select the Standard Rule tab.
- From the standard rule list, select Use Accumulator.
- Click New.
The
system displays the Edit Accumulator Entry dialog box to create a
new calculation for this element.
- From the Primary Accumulator list, select primary accumulator
1. This accumulator currently contains the total quantity.
- From the First list, select Use primary.
This operation specifies that the system loads the current value of
the accumulator into the CTT02 (Hash Total) element.
- Click OK to add the accumulator.
- Click OK on the Element Properties
dialog box to add the standard rule to the CTT02 element. The CTT02
element now contains the total quantity of the purchase order.