Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 3 of 5

UN/EDIFACT anatomy

9 min

Listen to this lesson

0:00 / 11:00

UN/EDIFACT is the international counterpart to X12, maintained under the United Nations (UN/CEFACT) and dominant in Europe, much of Asia, and in global automotive and logistics. Contoso trades only in X12 today, but the moment it sells to a European distributor or joins a global OEM program it will meet EDIFACT. So this lesson uses a what-if: a European aftermarket distributor sends Contoso an EDIFACT purchase order for 20 alternators.

UNA:+.? '
UNB+UNOC:3+EUDISTRIB:ZZ+CONTOSOMC:ZZ+261014:0915+4402++ORDERS++1'
UNH+1+ORDERS:D:96A:UN'
BGM+220+EU-7730+9'
DTM+137:20261014:102'
DTM+2:20261028:102'
NAD+BY+EUDISTRIB::92'
NAD+SU+CONTOSOMC::92'
LIN+1++CMC-ALT-100:SA'
QTY+21:20'
PRI+AAA:250.00'
UNS+S'
CNT+2:1'
UNT+12+1'
UNZ+1+4402'

Service characters and the UNA string

EDIFACT also uses delimiters, but its defaults are different and they are declared in an optional UNA service string advice at the very start: UNA:+.? '. Read it character by character:

PositionCharacterRole
1:Component data element separator
2+Data element separator
3.Decimal notation
4?Release (escape) character, so ?+ means a literal plus sign
5spaceReserved (repetition separator in syntax version 4)
6'Segment terminator

The six characters of the UNA service string advice.

If UNA is missing, the defaults apply. The release character is a classic source of bugs: a company name like "Smith+Sons" must be sent as Smith?+Sons, or the receiver splits it into two elements.

Envelopes

LevelX12EDIFACTNotes
Delimiter declarationInside ISAUNA (optional)EDIFACT defaults apply when UNA is absent
InterchangeISA ... IEAUNB ... UNZSender, receiver, date and time, control reference
GroupGS ... GE (mandatory)UNG ... UNE (optional, rarely used)Most EDIFACT interchanges skip groups
MessageST ... SEUNH ... UNTUNT carries the segment count and repeats the message reference
X12 and EDIFACT envelopes line up level by level, but EDIFACT groups are optional.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-101

The UNB interchange header names the syntax identifier and version (UNOC:3: character set level C, syntax version 3), the sender and recipient IDs with their code qualifiers, the preparation date and time, and the interchange control reference (here 4402), which UNZ repeats. The ninth element of UNB, set to 1 in the sample, is the acknowledgment request: the sender asks for a CONTRL message back.

The syntax identifier matters more than it looks. UNOA and UNOB are restricted character sets (UNOA is uppercase only), while UNOC covers the Latin-1 range with accented letters, which European partners need for names and addresses. Syntax version 3 is still the most common; version 4 adds features such as the repetition separator in UNA position 5 and is used by newer implementations. If a partner sends UNOA and Contoso's outbound map writes lowercase customer names, the partner's translator may reject the reply, so the character set belongs in the partner checklist.

The UNH message header is where EDIFACT names the business document: ORDERS:D:96A:UN means message type ORDERS, from directory D.96A, controlled by the UN. That directory version is the EDIFACT counterpart of the X12 version number. The UN publishes directories twice a year (D.96A, D.01B, D.21A and so on), and partners agree on one. D.96A and D.01B remain very common in automotive and retail.

Reading the ORDERS body

SegmentIn the sampleMeaning
BGM220+EU-7730+9Beginning of message: document name code 220 (order), the buyer's order number, message function 9 (original)
DTM137:20261014:102 and 2:20261028:102Qualifier 137 = document date, 2 = delivery date requested; format 102 = CCYYMMDD
NADBY, SUName and address: BY buyer, SU supplier (DP would be the delivery party)
LIN1++CMC-ALT-100:SALine 1, item number with type SA (supplier's article number)
QTY and PRI21:20 and AAA:250.00Qualifier 21 = ordered quantity; AAA = net calculation price
UNS and CNTS and 2:1Section control between detail and summary; control total 2 = number of line items

The business content of the what-if EDIFACT ORDERS message.

An EDIFACT message has a header, detail and summary section inside UNH and UNT, all wrapped by UNB and UNZ.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-101

X12 and EDIFACT side by side

The two standards carry the same business meaning with different vocabulary. An X12 850 BEG becomes an EDIFACT BGM with code 220; DTM exists in both but with different qualifier code lists; N1 becomes NAD; PO1 becomes a LIN group with QTY and PRI. Neither standard is better. What matters is which one the partner uses and which directory or version is in its guide.

X12, North AmericaUS and Canadian retail, distribution, fleet and automotive aftermarket; Great Lakes Fleet Services
EDIFACT, North AmericaSubsidiaries of European groups that keep their head office standard
X12, globalUS-headquartered OEMs that push X12 to their suppliers worldwide
EDIFACT, globalEuropean retail, global automotive, ocean logistics and customs
Which standard a supplier meets depends mostly on who the partner is and where it is headquartered.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-101

What would you do?

The European distributor's test file reaches PO, but the translator rejects it: the NAD segment for the buyer has one element too many. The company name in the file is <code>BRAKE+FLEET GMBH</code>. What is the most likely cause?

Key points
  • EDIFACT declares its delimiters in the optional UNA string; the release character ? escapes delimiter characters in data.
  • UNB/UNZ wrap the interchange, UNG/UNE optionally wrap groups, and UNH/UNT wrap each message.
  • UNH names the message type and directory, such as ORDERS:D:96A:UN; partners agree on the directory.
  • X12 dominates North America, EDIFACT dominates Europe and global trade, and industry subsets such as EANCOM add rules.

Check your understanding · not graded

Lesson check

  1. 1. In <code>UNH+1+ORDERS:D:96A:UN</code>, what does <code>D:96A</code> identify?

  2. 2. What is the role of the <code>?</code> character in the default EDIFACT service characters?

  3. 3. Which EDIFACT envelope level is optional and rarely used, unlike its X12 counterpart?