Quantcast
Channel: B2B Integration with SAP Process Orchestration
Viewing all articles
Browse latest Browse all 100

Separators in ANSI X12 EDI Message

$
0
0

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'.

sep_1.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).

sep_2.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'.

sep_4.jpgsep_3.jpg

Handling these separators:


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


sep_5.jpg

Reasons

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

2) If DataElementSeparator or SegmentTerminator are 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

sep_6.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)

sep_9.jpg



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

sep_7.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)

sep_8.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))

sep_10.jpg

Ideally, Unicode control characters are not allowed in XML representation

sep_11.jpg

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

sep_12.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

 

Attachment - ASCII table


Viewing all articles
Browse latest Browse all 100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>