Saturday, August 9, 2025

X12 (ANSI) ASN and EDIFACT DESADV

 Here’s a comprehensive breakdown covering both X12 (ANSI) ASN and EDIFACT DESADV formats, along with hierarchical structures (HL vs CPS/PAC) and sample documents to help you visualize how they correspond.


1. ANSI X12 856 ASN — Structure & Sample

Hierarchical Structure (HL Loops)

The ANSI X12 856 uses a nested HL (Hierarchical Level) structure with these loops:

  • S – Shipment

  • O – Order

  • T – Tare (Pallet)

  • P – Pack (Carton)

  • I – Item
    This hierarchy flexibly supports various ASN types (Pick-and-Pack, Pallet, Mixed, etc.).

Sample 856 ASN (Generic)

ISA...
GS...
ST*856*0001~
BSN*00*SHIPMENTID*20231014*1831~
HL*1**S~
TD1*CTN25*24...
TD5*...
REF*BM*...
DTM*011*20231014~
N1*ST*...~
HL*2*1*O~
PRF*0123456789~
TD1*...
N1*BY*...~
HL*3*2*P~
MAN*GM*...~
HL*4*3*I~
LIN**IB*PRODUCT1...
SN1**24*EA~
...
CTT*1*5~
SE*36*0001~
GE*...
IEA*...

This example illustrates shipment with nested order, pack, and item loops.


2. EDIFACT DESADV — Structure & Sample

Hierarchical Structure (CPS & PAC)

EDIFACT DESADV uses:

  • CPS (Consignment Packing Sequence) — defines packaging hierarchy (e.g., pallet vs carton)

  • PAC (Package) — details packaging units

  • LIN (Line Item) — specifies items inside packages

Relationships among CPS levels use:

  • CPS-01 — unique ID

  • CPS-02 — parent ID (hierarchical nesting)

  • CPS-03 — packaging level (e.g., 1 = inner, 3 = outer)

DESADV Sample (Simple)

UNH+54321+DESADV:D:01B:UN:EAN011+2.0'
BGM+351::9:WAREHOUSE+DEL12345:9'
DTM+137:20200203'
NAD+BY+...:9'
NAD+SU+...:9'
CPS+1'
PAC+1'
CPS+2+1'
PAC+1++201'
PCI+30'
GIN+BJ+123456789012345675'
LIN+1++40700719670720:SRV'
QTY+12:21'
UNT+29+54321'

This shows a nested packaging structure (CPS with PAC) and item detail (LIN/QTY).

DESADV Sample (Detailed with Multiple Levels)

UNH+1+DESADV:D:96A:UN:A01051
BGM+351+12345
DTM+137:200905050506:203
NAD+... (carrier/buyer/seller)
TDT...
CPS+1++1
PAC+4
QTY+52:48:PCE
LIN+++1234:IN
QTY+12:192:PCE
RFF+ON:...
CPS+2++1
PAC+10
...
CPS+3++3
PAC+2++PLT1::92
UNT+34+1
UNZ+1+31

This shows pallets and cartons (nested under CPS), with item quantities and references.


3. Comparative Mapping: X12 vs EDIFACT

Logical Level X12 (856 HL Loop) EDIFACT (DESADV)
Shipment HL S UNH → BGM / header segments
Order HL O NAD / RFF segments (order ref)
Pallet/Tare HL T CPS (packaging level = outer = 3)
Carton/Pack HL P CPS + PAC (packaging level = inner)
Item HL I LIN + QTY
Hierarchy Tracking HL with parent pointer CPS-02 parent ID field

4. Visual Flow Diagrams (Text Sketch)

ANSI X12 ASN Flow

Shipment (HL S)
 └ → Order A (HL O)
      └ → Pack 1 (HL P) → Item 1, Item 2 (HL I)
      └ → Pack 2 (HL P) → Item 3 (HL I)
 └ → Order B (HL O)
      └ → Pack 3 (HL P) → Item 4 (HL I)

EDIFACT DESADV Flow

CPS 1 (Pallet Level, level=3)
 └ PAC / packaging info
 └ GIN / item identifier
 └ CPS 2 (Carton inside Pallet, level=1)
      └ PAC
      └ LIN / Item detail
 └ CPS 3 (Another Carton)
      └ PAC
      └ LIN

No comments: