Skip to main content

Part 4. UN/EDIFACT Rules - Chapter 2.2 Syntax Rules - Annex C

ANNEX C (Informative)

 

ORDER OF SEGMENTS AND GROUPS OF SEGMENTS WITHIN A MESSAGE


The segments used in a message shall appear in the sequence (top to bottom, left to right) specified in the Message Diagram.
Segments are indicated by their codes. The requirement for their inclusion in the message, i.e. their status, is indicated directly below the codes by the letter M for mandatory or C for conditional. The number of times a segment may appear in each instance is indicated directly thereafter. A mandatory segment shall appear at least once but not more times than indicated. A conditional segment may be excluded or appear up to the number of times indicated.
When a segment nests in an other segment, it shall be placed on the next lower level in the diagram. Segments in level zero shall not be repeated and shall not contain nested segments.
Two or more segments can be grouped. This is indicated by a box in the diagram. The group and the segments in the box can be mandatory or conditional and can appear up to the number of times indicated. A group can contain another, lower level group or groups (Gr.3 and Gr.4 in the example).
A message shall begin with the message header segment UNH and end with the message trailer segment UNT.
EXAMPLE: Parts of a fictitious message type:

Level
     ___________________________________________________________
     |    |   |    |           |           |               |   |
 0  UNH  AAA  |    |           |           |               |  UNT
    M 1  M 1  |    |    _______________    |    _______    |  M 1
 1           BBB  CCC   |     DDD     |   HHH   | III |   LLL
             C10  C10   |     M 1     |   C 5   | M 1 |   C 5
                        |      |      |         |__ __|
                        | ___________ |         || | ||
                        | |    |    | |         || | ||
 2                      |EEE  FFF  GGG|         || | ||
                        |C10  C 5  C 5|         ||JJJ||
                        |_____________|         ||M 1||
                        |Group 1 C 200|         || | ||
                        |_____________|         || | ||
                                                || | ||
                        Segment Group 1         || | ||
 3                      Conditional             ||KKK||
                        Repeatable up           ||C 1||
                        to 200 times            ||___||
                                                ||Gr3||
                                                ||C10||
                                                ||___||
                                                |_____|
                                Segment Group 3 |Gr.4 |
                                inside Group 4  |C 10 |
                                                |_____|


      Segments may alternatively be represented as follows:
      _____
      |UNH|
      |___|
      |M|1|
      |___|


The processing/sequencing order of the segments is as follows (Group 1 appearing twice, the other groups once and segments not repeated):
UNH,AAA,BBB,CCC,DDD,EEE,FFF,GGG,DDD,EEE,FFF,GGG,HHH,..,III,JJJ,KKK,...,LLL,UNT