A segment in an EDI transaction set is a group of like data elements.
If you were filling out information on a purchase order, you would expect to see groups of related data. For example, look at the diagram below of a paper purchase order in which only one item is being ordered. Note that there are four sections, each providing a different set of information:
In an EDI document, each section is described by a particular segment. Below is the set of EDI segments that would describe the purchase order above when using the EDIFACT standard. Each segment begins with a 3-character code (e.g. UNH, BGM, DTM, NAD, LIN, QTY,PRI, UNS, CNT, UNT) that describes the type of data elements that follows. The elements within each segment are separated by a data element separator, in this case the ‘+’. The segment is ended by a segment terminator, normally, the apostrophe (‘).
|UNH, to indicate start of message – in this case ORDERS
|BGM, to indicate the beginning of the PO message
|DTM, to indicate the date/time period
|NAD, to identify the buyer code corresponding to the name/address
|LIN, to describe line item detail
|QTY, to define the quantity
|PRI, to define price
|UNS, section control segment to separate line item detail from summary information
|CNT, to provide the number of line items
|UNT, to indicate the end of the PO
For each type of business document, the EDI standard documentation defines:
- The segments that may be included and which ones are mandatory, optional and/or conditional (i.e. must be included only if another segment or element is included)
- For each segment, the elements that may be included – for every piece of information in a paper document there is a corresponding EDI element. These elements are defined in the standards dictionary and each standard has its own dictionary
- The required sequence of the segments and elements
- How many times a segment may be repeated
Now, once all the segments are collected into a prescribed sequence, they form a complete electronic document, or transaction set. Next, the transaction sets must be put into envelopes in preparation for transmission to your partners.
Read about envelopes »