Failing EDIFACT flows: 5 common causes and how to find them
An order arrives in EDIFACT, the ERP will not import it, and nobody quite knows why. In most missions I see, the cause falls into five families. Going through them in order saves hours.
1. The envelope is wrong before the content
Before reading a single order line, check the envelope: the UNB (interchange) and UNH (message) segments. Sender and recipient identifiers, syntax version, the counters in UNT and UNZ. A wrong segment count is enough for a strict gateway to reject the whole message.
2. The message version does not match the guide
A partner may send an ORDERS D.96A while your mapping expects D.01B. Qualifier codes change between versions. Compare the version declared in UNH with the agreed implementation guide, not with what you think you signed.
3. A qualifier or code unknown to the ERP
The message is valid, but a unit of measure, country code or item code does not exist in the ERP. The symptom is a rejection at import, not at receipt. The ERP log is then more useful than the gateway log.
4. Characters and separators
Separators wrongly declared in UNA, an escape character (?) forgotten in free text, UTF-8 versus ISO 8859-1 on an accented name. These errors are quiet: the file “looks fine”.
5. The transport, not the message
An incomplete file on an SFTP read while still being written, an expired AS2 certificate, an acknowledgement (CONTRL) never sent back. If the message does not arrive, you are not debugging the mapping.
A simple method
- Take one failing message and one that passes, from the same partner.
- Compare them segment by segment, envelope first.
- Look for the error in the first log that saw it, not the last.
- Once fixed, replay the original message and keep it as a test case.
An EDI flow that fails silently costs more than one that fails loudly. Add an error notification before optimising anything else.
If your flow is blocked and the cause is still unclear, it is a good scoping topic: a few hours are usually enough to produce a written diagnosis.