BGM
Beginning of Message. The segment that opens every EDIFACT message: type, number, function, response type expected.
Definition
The BGM segment is designed, per the official D.96A function statement, "to indicate the type and function of a message and to transmit the identifying number". Its structure has four elements:
- 010 — C002 (Document/Message Name): coded document name
(element 1001), via UNCL 1001 — for instance
220for a purchase order,351for a despatch advice,380for a commercial invoice. - 020 — 1004 (Document/Message Number): the document reference number, up to 35 characters. This is the "human" identifier of the order, despatch note or invoice.
- 030 — 1225 (Message Function, Coded): message function
(UNCL 1225) —
9Original,1Cancellation,5Replace, etc. - 040 — 4343 (Response Type, Coded): response type
expected (UNCL 4343) —
ACAcknowledge,ABMessage acknowledgement, etc.
Origin
BGM is one of the oldest service segments in the EDIFACT directory, present
since version 1 published in 1987. It always occupies the second position
in a message, immediately after the message header
(UNB at interchange
level, UNH at message level). Directory D.96A, archived on ediverse.io,
is dated 27 November 1995. The segment is defined in the TRSD table:
trsdbgm.htm.
Example in context
First line of an ORDERS message — purchase order PO-2026-00042:
The 220 code in C002/1001 says "order" per UNCL 1001,
PO-2026-00042 is the PO number as generated by the buyer's
ERP, and the trailing 9 states that this message is the
original — not a cancellation, not a replacement.