X12856ASNMappingIBM Sterling

How do I map X12 856 HL loops correctly for a multi-pallet shipment?

Asked by jmartinez_edi (EDI Practitioner) on 2026-08-02 · 1820 views

34votes

I'm building an 856 ASN map for a new retail trading partner. My shipment has 3 pallets, each with 2 cartons, each carton containing multiple line items. I keep getting HL hierarchy errors on the 997. What's the correct HL01/HL02/HL03 structure for a Shipment → Pack (pallet) → Pack (carton) → Item hierarchy?

2 Answers

41votes

Each HL loop needs a unique, sequential HL01 and its HL02 must point to the HL01 of its direct parent. For your case: HL*1**S (Shipment, no parent) HL*2*1*O (Order, parent = HL1) HL*3*2*P (Pallet-level Pack, parent = HL2) HL*4*3*P (Carton-level Pack, parent = HL3 — yes, nested Pack levels are valid) HL*5*4*I (Item, parent = HL4) The most common mistake causing 997/999 hierarchy rejects is pointing a lower-level Pack back to the Order loop instead of its immediate parent Pack. Since you have nested packaging (pallet containing cartons), each carton's HL02 must equal the pallet's HL01, not the order's.

dana.koenig · EDI Expert · 2026-08-02

12votes

Adding to Dana's answer — also double check that your CTT01 segment count matches the total number of HL loops, not just the item-level ones. A lot of translators default to counting only PO1-equivalent lines, which will cause a silent mismatch even if the hierarchy itself is fine.

priya_integration · EDI Specialist · 2026-08-03