Skip to Content
Author's profile photo Former Member

Separators in ANSI X12 EDI Message

In an ANSI X12 EDI Message, we have Data element separator, Component Element Separator and Segment Terminator in the ISA segment.

 

D_DATAELEMENTSEPARATOR (Data Element Separator) is at 1st position in the ISA segment which is used to determine the delimiter in between the elements of one segment across the EDI Document. This is an optional element whose default value is ASCII character (*) hexadecimal value ‘2A’.

/wp-content/uploads/2014/04/sep_1_426214.jpg

D_I15 (Component Element Separator) is at 16th position in the ISA segment which is used to determine the end of ISA (interchange start).

/wp-content/uploads/2014/04/sep_2_426266.jpg

D_SEGMENTTERMINATOR (Segment Terminator) is at 17th(last)  position in the ISA segment which is used to determine the delimiter in between the segments of across the EDI Document. This is an optional element whose default value is ASCII (LF) Line Feed (\n) hexadecimal value ‘0A’.

/wp-content/uploads/2014/04/sep_4_426267.jpg/wp-content/uploads/2014/04/sep_3_426268.jpg

Handling these separators:

 

Issue 1 Failed in component – Module exception (x12 converter exception)

 

/wp-content/uploads/2014/04/sep_5_426275.jpg

Reasons

1) If  length of any of the separators is more than one (1)

2) If DataElementSeparator or SegmentTerminator is alphanumeric

 

Analysis

1) Numbers (0,1,2…), letters (A, B…), combination (A1,1B…) are not accepted

2) Escape sequences /n, /r,… etc. are  directly passed (hard-coded in mapping) – this is treated as length (>1) and alphanumeric

3) Only special characters of length = 1 are acceptable eg. |,*,^,\,{,},/…..

 

ASCII characters

(printable ASCIIcharacters e.g. 0x85, 0x0A,0x0D,0x5E,0x7B- see attached for list of printable ASCII characters and extended ASCII)

UDF returning the ASCII characters based on hex values can be used to map these separators

/wp-content/uploads/2014/04/sep_6_426276.jpg

0x0a separator (new line)Segment Terminator is an optional field (default value is 0A (/n)); every segment is separated by a linefeed when this field is not mapped)

/wp-content/uploads/2014/04/sep_9_426279.jpg

 

 

Issue 2– String Index out of range (x12 converter exception)

/wp-content/uploads/2014/04/sep_7_426277.jpg

Reason

 

If DataElementSeparator or SegmentTerminator have ASCII characters whose hexadecimal values are of length more than 3

 

Case– Up tack symbol (┴) (hex value -22a5)

/wp-content/uploads/2014/04/sep_8_426278.jpg

Analysis–ASCII characters whose hex values are out of range

Possible values ( ASCII printable chars (..62,63,..), escape chars (..0A, 85, 0E..), Extended ASCII (…128,..136..)

Values such as up tack (┴) with hex value -22a5 are not acceptable as element or segment separator in an EDI file

(see attached ASCII table)

 

 

Case– Control characters as segment separator in an inbound EDI file

 

Some partners generate EDI files with control characters as segment separators (e.g. NAK – Negative Acknowledgement , hex (15))

/wp-content/uploads/2014/04/sep_10_426280.jpg

Ideally, Unicode control characters are not allowed in XML representation

/wp-content/uploads/2014/04/sep_11_426281.jpg

This is taken care at conversion level (X12 converter module takes care of removing Invalid XML character)

/wp-content/uploads/2014/04/sep_12_426282.jpg

And the optional segment terminator is treated internally as default New line (hex 0A)

 

Summary:

 

Element

Description

Position in ISA

Occurrence

Length

Default Value

Limitation

D_DATAELEMENTSEPARATOR

Data Element Separator

1

Optional

1

*

Only special(escape) characters whose hex value is in range

D_I15

Component Element Separator

16

Mandatory

1

Any character (length restriction (1))

D_SEGMENTTERMINATOR

Segment Terminator

17

Optional

1

New Line

Only special(escape) characters whose hex value is in range

 

AttachmentASCII table

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Where do I control which character to have in D_DATAELEMENTSEPARATOR?

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      We need not worry about element separator in an inbound file ( it is taken care at adapter level)

      For an outbound we can, configure the separator in TPM based on different partners or have a value mapping (look-up) to retrieve separator values based on partners

      Please go through below blog for further details

      ISA and GS segment values - Value mapping v/s Predefined TPM UDFs - I

      Author's profile photo Former Member
      Former Member

      Hi Pooja,

      I must appreciate you for the nice post. Could you share your experience with regards to SD functional consultant role in Sap EDI implementation and support projects.

      Thanks

      chekri

      Author's profile photo Yee Loon Khoo
      Yee Loon Khoo

      Hi Chekri,

      Let me attempt to answer you based on my experience.

      SD functional consultant:
      Need to able to understand the whole business process flow, corresponding EDI message type to idoc types, the dependency of each idoc and edi message types. Able to understand the meaning of idoc segment, field and qualifier. Need to understand the meaning of message implementation guide by customer and produce message mapping specification. Important is able to advise technical PI consultant how to map certain message type, especially when it is completely new message type. Liaise with business user during UAT and go live.

      EDI/PI technical consultant:
      Able to understand message mapping specification provided by functional consultant, at the same time understand the message implementation guide by customer too. Develop the mapping based on specification, perform unit testing and provide the test result to functional consultant to perform UAT. Go live standby support.

      Regards,

      Yee Loon

      Author's profile photo Former Member
      Former Member

      Thank you Yee Loon for your reply. Makes sense in what you say.

      Regards,

      Chekri

      Author's profile photo Former Member
      Former Member

      Hi, thanks for your document.

      But how could I adjust the separator of N9-C040-D-128 and N9-C040-D-127?  In previous version, the separator is '>' (IA>23292). But after upgraded to new B2B version, it became to '\' (IA\23292)

      Author's profile photo Former Member
      Former Member

      Hello Pooja,

      We are working on outbound scenario ( SOAP to EDI 850 File). We have issue with D_SEGMENTTERMINATOR field. We are setting the value '~' or '|' in value mapping. But when converter module generates file, end seperator is not visible. All lines in file are on seperate line looks default seperator is used.

      Could you please help me to fix issue ?

      Author's profile photo Former Member
      Former Member

       

      Author's profile photo Bhavana C
      Bhavana C

      Hello,

      My scenario is to receive EDI 810 invoice from VAN. I have inbound EDI 810 document with '<0x85>' as a segment terminator. I am not sure how to handle this as it is getting error out at EDI separator receiver channel.

      Is there any way that i can handle this ASCII char segment terminator in PI ?

       

      Thanks !