EDIFACT (Parser)

EDIFACT data already has a tree structure. This makes it very easy to parse EDIFACT files into source structures. The user only has to specify the character encoding and whether the data is zipped.

Important note: Frequently, EDIFACT structures are changed by companies for their own purposes, in which case the source structure can be modified by the user. The source structure from a template (or manually generated) can be adapted by the user in this case. However, it should be noted that names of segments cannot be adapted arbitrarily, but must always comply with the syntax SG<number><any suffix> so that they are recognisable for the parser. So you cannot rename segment SG2 to Items, however SG2-Items would be possible.

Note: See also section Working with Templates.


images/download/attachments/55937705/EDIFACT_5_EN-version-1-modificationdate-1594089739175-api-v2.png


(1) If this checkbox is set, the input fields are checked against their format templates during parsing. If a value violates the format template of the field or exceeds the field length or if a mandatory field is empty, an error is created. If an error occurs, the profile job will not be aborted immediately in phase 2, but at the end of phase 2 or after 50 errors. Attention: The use of format checking puts a strain on performance and should only be used if absolutely necessary.

(2) If set, then the minimum and maximum values of nodes in the source structure are checked. In addition, the following segments are checked: UNT (number of segments), UNZ (control count), UNE (control count).

Splitting of EDIFACT Files


If a file contains multiple EDIFACT documents (UNB-UNZ), Lobster_data can split that file into multiple files (3). But the documents have to be of the same EDIFACT type. Each one of those single documents will then start a job. If this checkbox is not set, then only one job will be created.

Note: If you use the Tradacoms format (4), this setting also applies, but the STX-END segments are then used for the split.

Tradacoms Format


The Tradacoms format is similar to the EDIFACT format, but it uses another parser. If checkbox (4) is set, the data is forwarded to the Tradacoms parser. In this case the checkboxes (5) to (9) do not work, all others do.

You can automatically generate a source structure from a Tradacoms message (i.e. the data file, there is no schema file for the Tradacoms format). See subarea Importing Structures in area General Data (GUI). A corresponding destination structure can be generated with a 1:1 mapping. The TradaComsCreationUnit can then be used to generate a Tradacoms document out of this destination structure.

Check of EDIFACT Files


General structural checks that always take place:


  • UNA segment, if present, must have correct length, evaluation of UNA (separator, etc.).

  • Occurrence of UNH and UNZ.

  • UNG treatment.

  • Source structure definitions (number of fields in component, segments must be named SGxxxx).


Note: See also (1) and (2).

(5) The following segments are checked: UNT (number of segments, UNT/UNH comparison), UNZ (counter, reference field UNB.0020), UNE (counter, reference field 0048, reference field 0060).

(6) Instead of the set profile encoding, the specified encoding of the message is used.

(7) An error is generated if the set profile encoding does not match the encoding of the message.

(8) If the encoding of the message is UNOA or UNOB, the values of the message are checked for the allowed characters of the encoding (e.g. a-Z, 0-9 etc.).

Creating EDIFACT CONTRL Messages on Errors


If an error occurs when parsing an EDIFACT message, a CONTRL message can be sent to a specified profile (9). The EDIFACT CONTRL message is only generated for phase 2 errors for version D03A.