Loading

Message Maps and Control Numbers

Two partners sending the same message type will not send the same message. Maps are how one document type serves both.

Where to find it

Architect Panel → ERP - Trading & Analytics:

  • EDI Maps — segment-to-field mapping per partner, message type and direction
  • EDI Control Numbers — the sequence counters per partner
  • EDI Messages — what was actually sent and received

Maps are per partner and per direction

A map row ties a segment path in the message to a slot in your document, for one partner, one message type and one direction. It can mark a field required, apply a transform, or supply a constant where the partner expects a fixed value you do not otherwise hold.

Inbound and outbound are mapped separately even for the same message type, because what a partner sends you and what they expect back are rarely mirror images.

Levels and ordering

Rows carry a level and a sort order, which is what handles the nesting real EDI messages have — a header with lines, and lines with sub-lines. Getting the level wrong is the usual cause of a map that produces a header value repeated on every line, or line values collapsed into one.

Mark required fields honestly

A field the partner will reject the message for is required; mark it. It is far better to fail on your side with a clear reason than to send an incomplete message and receive a rejection whose text is a segment reference.

Build maps from their specification

Work from the partner's specification document, not from a sample message. A sample shows what one message happened to contain, not what is mandatory, what is conditional, or what codes are permitted. Maps built from samples fail on the first message that differs — typically the first one with a special case in it.

Control numbers

Every partner has counters holding the next value for each type of control number. Interchanges and messages are numbered sequentially, and the partner uses those numbers to detect gaps and duplicates.

Never reset a counter

This is the one hard rule.

Resetting means resending numbers the partner has already seen, so they will treat genuine new documents as duplicates and discard them — silently, because from their side that is exactly what duplicate suppression is for. The result is orders that were sent, accepted by the transport, and never processed.

If numbering must change, agree it with the partner first. Left alone, the counters look after themselves.

Test both directions per message type

Send and receive each message type before going live. An outbound map that works tells you nothing about the inbound one for the same document.

Worked example

A supplier maps a customer's purchase order inbound: header segments to the document header, line segments at level 2 to document lines, with the customer's own product code transformed to the internal item reference. A constant supplies the delivery method the customer omits but the warehouse requires. Twenty test orders are processed before the map is trusted.

Recommendations

  • Never reset a control number.
  • Map from the specification, not from samples.
  • Check levels when values repeat or collapse.
  • Test each message type in both directions.