Scenario

In this scenario, we assume that no other accumulators are used anywhere else in the 856 map, and we will reference accumulators 0, 1, 2, 3—using a specific accumulator for each HL Level:

  • Accumulator 0 is used on all HL segments to populate the HL01 value
  • Accumulator 1 is used on the Order HL segment to populate the HL02 value
  • Accumulator 2 is used on the Pack HL segment to populate the HL02 value
  • Accumulator 3 is used on the Item HL segment to populate the HL02 value

The HL segment contains the following fields:

  • HL01–HIERARCHICAL ID NUMBER
  • HL02–HIERARCHICAL PARENT ID NUMBER
  • HL03–HIERARCHICAL LEVEL CODE
  • HL04–HIERARCHICAL CHILD CODE
    Note: This scenario does not include the procedure for populating the HL04 element.

The HL01 element (Hierarchical ID Number) identifies the HL segment numerically in the EDI document. The field starts at one and increments by one for each subsequent HL segment that is created. The accumulator 0 is used for the HL01 element. Each HL segment (Shipment, Order, Pack, and Item) uses the same accumulator for the HL01 element, and the map increments the accumulator and then uses the accumulator for each HL01 element.

The HL02 element (Hierarchical Parent ID) identifies the Parent HL segment to which the current HL segment belongs. The accumulator 1 is used for the HL02 in the Order HL segment, and this element is not populated in the Shipment HL segment because it is the first HL segment in the document.

The HL03 element (Hierarchical Level Code) indicates the level of the HL segment (Shipment, Order, Pack or Item) by using a code. S indicates the Shipment Level, O indicates the Order level, P indicates the Pack level, and I indicates the Item level. The map uses constants to populate this element.

For each HL, except for the innermost nested HL (which is Item in this scenario), the map also moves the value contained in accumulator 0, located on the HL01 element, into the accumulator that is used for the HL02 element in the next HL segment.

For example, the standard rule on the HL01 element in the Shipment HL segment increments accumulator 0 by one and places that value in the HL01 element. Then, the rule moves that same value into accumulator 1 for use on the HL02 element in the Order HL segment.