Posts Tagged ‘EDI’

In my last two posts I showed two possible errors, and their respective solutions, that can happen when we are validating dummy EDI message, provided by our partners, against the schema using Visual Studio, but these errors could also happen in runtime.

In this post I will show you one common error when we are validating an EDI solution.

After I deploy and correctly configured the solution, I was trying to receive an EDI document from a Receive Port, in order to convert it to XML format using the generic EDI pipeline: “Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive”, but I was always getting this error:

“There was a failure executing the receive pipeline:
“Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive,
Microsoft.BizTalk.Edi.EdiPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken1bf3856ad364e35” Source: “EDI disassembler” Receive Port: “IN_ORDER_PORT” URI: “E:\PORTS\EDI\IN_ORDER\*.*” Reason: No Disassemble stage components can recognize the data.“.

The message provided by our partner was this:

UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+31+1000100'

CAUSE

After some time trying to understand the reason of this problem, I realize that’s nothing wrong with my project, the problem is actually in the message that I’m using.

This error occurs because the message does not contain the EDIFACT interchange envelope segments (UNB and UNZ). An EDIFACT interchange begins with a UNB. It contains version release information, syntax information, and partner information. An interchange ends with a UNZ.

UNA Segment: The UNA segment is optional in an EDIFACT interchange. The specifications in the UNA segment define the characters used as separators and indicators for the interchange. Use this segment only if the interchange contains non-standard separator characters. (More information here)

UNB Segment: The UNB segment is compulsory to an EDIFACT interchange. This segment acts as the interchange header for a set of EDIFACT documents. The UNB segment elements identify the sender and recipient of the interchange, together with the date and time that the interchange was prepared and the agency controlling the syntax of the interchange. (More information here)

UNZ Segment: This segment is the Interchange Trailer segment of an EDIFACT document. This segment indicates the end of an interchange and checks the interchange reference and number of documents in the interchange. (More information here)

SOLUTION

Add this segment to your message: UNA (optional), UNB and UNZ and the message will be processed correctly.

Correct message:

UNA:+,?*'
UNB+UNOB:1+UNB2.1+UNB3.1+012301:0123+UNB5'
UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+31+1000100'
UNZ+1+UNB5'

As I mentioned in my last post, when we are in the development phase of a BizTalk project is normal to validate test instances of messages that are provided with respective schemas before we make final tests, the same happens when we are dealing with EDI (EDIFACT) messages.

When we perform this validation, we can detect if some enumerators in the existing EDI Schema contain all admissible values, or if your partner has some values customized and we have to reflect them in the schema.

Another common problem when we are trying to validate dummy EDI message, provided by our partners, against the schema using Visual Studio is:

” Invoking component…
C:\TestFiles\myEDIsample.txt: error BEC2004: Non Segment level : [29] Invalid count specified at interchange, group or message level“.

This is a very basic mistake, and usually occurs when dummy messages are delivered to us for testing.

Sample message:

UNA:+,?*'
UNB+UNOB:1+UNB2.1+UNB3.1+012301:0123+UNB5'
UNH+1000100+ORDERS:D:93A:UN:EAN007'
BGM+220+01521710'
DTM+137:120530:101'
DTM+64:120604:101'
DTM+63:120004:101'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
FTX+AAI+++SOME TEXT'
NAD+BY+8000000001164::9'
NAD+DP+8000000009463::9'
NAD+IV+8000000013002::9'
NAD+SU+8000001459008::9'
NAD+PR+8000000016003::9'
LIN+1++4001518722937:EN'
PIA+1+00:PV+14001518722937:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:52'
LIN+2++5000014010034:EN'
PIA+1+00:PV+15701014010031:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:152'
LIN+3++5000014016142:EN'
PIA+1+00:PV+15701014016149:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:304'
LIN+4++5006879009752:EN'
PIA+1+00:PV+15776879009759:EN'
IMD+F+M+:::SOME DESCRIPTION'
QTY+21:720'
UNS+S'
UNT+30+1000100'
UNZ+1+UNB5'

CAUSE

This error is a notification that the number of groups, messages, or segments does not match the number given in the UNZ, UNE, UNT, or UST segment; or that the length of an object or the length of encrypted data is not equal to the length stated in the UNO, UNP, USD, or USU segment, i.e., the control count does not match number of instances received.

UNT Segment: UNT is the Message Trailer segment of an EDIFACT document. The UNT segment elements provide information about the number of segments in a message and the reference number for the message. This segment indicates the end of a document.

The following table lists the mandatory elements that the UNT segment contains:

  • Number of Segments in the Message: This element contains the total number of segments in the message.
  • Message Reference Number: This element contains a unique reference number for the message assigned by the sender. This number must be unique to the functional group, and must match the Message Reference Number in the UNH Segment.

So the problem is that in the sample message the Number of Segments in the Message in UNH segment is 30 and the message has in fact 31 (starting count from the UNH segment up to UNT segment).

SOLUTION

You have to change the Number of Segments in the Message element in UNT segment so that contains the correct number of groups, messages, or segments, in this case 31.

Other interesting resources:

Triggered by a question in BizTalk Forum, I started researching and testing if really BAM Tool is a requirement to install for EDI/AS2 Runtime functionalities.

I was particularly interested in EDI functionality because I’m advising one of my clients to migrate from BizTalk 2006 R2 to 2010 and I really need to know the basic requirements

So, is BAM Tools a prerequisite for EDI/AS2 Runtime in BizTalk Server 2010?

That depends on the functionalities (features) you want to install, but for me the correct answer is NO.

Considerations for Configuring the BizTalk EDI/AS2 Runtime

BizTalk EDI/AS2 Runtime is divided in 3 functionalities:

  • BizTalk EDI Functionality
  • BizTalk AS2 Functionality
  • BizTalk EDI/AS2 Runtime Status Reporting

When you configure the BizTalk EDI/AS2 Runtime in BizTalk Server 2010, consider the following:

  • Enterprise SSO, Group, and BizTalk Runtime must be configured prior to configuring BizTalk EDI/AS2 Runtime.
  • BAM must be configured prior to enable the AS2 and/or EDI/AS2 Runtime Status Reporting features.
  • If you are only configuring EDI, then BAM is not required.

More info here.

In resume:

  • For the last two functionalities “BizTalk AS2 Functionality” and/or “BizTalk EDI/AS2 Runtime Status Reporting”, BAM Tools must be configured!
  • But if you want ONLY EDI functionality you don´t need BAM Tools.

Proof of concept

I create a machine only with SQL installed (no Analysis Services and no Integration Services) and after installed BizTalk with these components:

EDI-BizTalk-Components

I opened “Microsoft BizTalk Server Configuration Wizard” and selected “Custom configuration” option:

EDI-BizTalk-Custom-Configuration

Note: BAM Tools appears on the right tree, because this is necessary only for AS2 and EDI/AS2 Status Reporting feature.

The next step was to configure the following components:

  • Enterprise SSO
    • Enterprise SSO Secret Backup
  • Group
  • BizTalk Runtime
  • Business Rules Engine
  • And BizTalk EDI/AS2 Runtime with only this two options selected:

EDI-Enable-BizTalk

Leave “BAM Tools” and “Bam Alerts” Disable.

EDI-Disable-BizTalk-BAMTools

Configuration Summary

EDI-BizTalk-Custom-Configuration-summary

EDI-BizTalk-Custom-Configuration-result

EDI-BizTalk-Custom-Configuration-overview

Conclusion

Although the BAM Tools is an optional requirement and even if you don’t use AS2 functionalities, I advise you to install and configure in order to benefit of all EDI functionalities that BizTalk Server 2010 has to offer you.

Tags: BizTalk | EDI | Requirements

ERROR: Invalid value in data element

Data Element ID: FTX01

Position in Segment: 3

Position in Field: 2

Data Value: ZZZ

12: Invalid value in data element

CAUSE

  • Your Data elements FTX01 contain the invalid code, “ZZZ”. These elements have specific lists of allowable codes.

SOLUTION

  • This code must be added to the list of the FTX01 element in the schema.

ERROR: Data element too long

Data Element ID: C08001

Position in Segment: 5

Position in Field: 1

Data Value: XXXXXXXXX X�X DE X�XXXX XX XXXXX

39: Data element too long

CAUSE

  • The value “C08001” is too long for the defined length of the element.

SOLUTION

  • Check the max length of the UNB9 element and correct your data. If you and your trading partner agree, both may increase the max length, in which case you would modify your schema.

ERROR: Invalid character(s) found in data element

Data Element ID: UNB11

Position in Segment: 11

Data Value: METCASH-AC3:ZZ

Or

Data Value:

37: Invalid character(s) found in data element

CAUSE

  • You have bad data in an UNB11 element.
  • You have an invalid character in an UNB11 element.

SOLUTION

  • Often this error occurs when you put a space in a mandatory element to avoid failing for missing mandatory. If this is the situation and you have no valid data for the element, you may have to change the element to optional in the schema.
  • This could be either the ‘-‘ or the ‘:’, or both, depending on the character set you are using and on what separators you using. If this is an outbound transaction, you can use a script to remove or replace the offending character

ERROR: Duplicate Control Number

Error: 1 (Miscellaneous error)

25: Duplicate Control Number

Error: 2 (Field level error)

SegmentID:

Position in TS: 1

Data Element ID:

Position in Segment: 13

Position in Field: 1

Data Value: <n>

25: Duplicate Control Number

CAUSE

  • This problem occurs because the interchange control numbers in the ISA13 segment of the suspended EDI messages are still recorded in BizTalk Server. This causes a duplicate detection check to be performed.

SOLUTION

References:

Tags: BizTalk | EDI | Errors and Warnings, Causes and Solutions

In a previous project I worked with EDI message to interchange with partners, but before I send the message to the partner I have the need to pass then to o loopback adaptor, that was configured with EDISend pipeline and EDIReceive Pipeline.

The objective is to get some proprieties, configured in the Party, that I need to precede the orchestration.

The send work well and create a correct EDI message, but on the receive I expect a Edifact Interchange Message but when I receive back the message it gives the following error:

“Transation Set Errors

Sequence No: 1

TS Id code: INVOIC

Control Number: 1

Error: 1 (Field level error)

SegmentID: NAD

Position in TS: 13

Data Element ID: C08001

Position in Segment: 5

Position in Field: 1

Data Value: XXXXXXXXX X�X DE X�XXXX XX XXXXX

39: Data element too long

For more information, see Help and Support Center at”

CAUSE

  • The value “C08001” is too long for the defined length of the element.

This error is simple and it occurs because the total of characters, including spaces, is greatest that what is allowed in element C08001, “XXXXXXXXX X�X DE X�XXXX XX XXXXX” contains 36 chars and the element allows 35.

But, if you look careful, the string has encoding problem:

  • The first sequence of this 3 characters “�” represents the char “Ô
  • And the second sequence represents the char “Ç”

In my case, the problem is not the size of the string but the character set configured in the party, which causes that the string length is greatest than it really is.

SOLUTION

  • Check the max length of the UNB9 element and correct your data. If you and your trading partner agree, both may increase the max length, in which case you would modify your schema.

To resolved encoding problems (my situation)

  • In the party, select EDI Properties and change the character set for a party by setting the UNB1.1 party property in the UNB Segment Definition property page for the party as interchange receiver.
    • Under “Party as Interchange Receiver” -> “EDIFACT Interchange Envelope Generation” -> “UNB Segment Definition” –> “Syntax (UNB1)” -> “UNB1.1 (Identifier)”
    • In my case, I used UNOD, more tolerant encoding (As defined in ISO 8859-2 : Information processing – Part 2: Latin alphabet No. 2.)

Tags: BizTalk | EDI | Errors and Warnings, Causes and Solutions

For EDIFACT encoded interchanges, you can set the character set for a party by setting the UNB1.1 party property in the UNB Segment Definition property page for the party as interchange receiver.

The encoding used in an incoming interchange is determined by the value of the UNB1.1 field in the header of the interchange.

This topic indicates which character sets are supported in the EDIFACT features of BizTalk Server:

Encoding Allows
UNOA As defined in ISO 646 (with the exception of letters, lower case a to z).

  • A to Z
  • 0 to 9
  • . , – ( ) / = (space)
UNOB As defined in ISO 646

  • All of UNOA
  • a to z
  • ‘ + : ? ! ” % & * ; < >
UNOC As defined in ISO 8859-1 : Information processing – Part 1: Latin alphabet No. 1.
UNOD As defined in ISO 8859-2 : Information processing – Part 2: Latin alphabet No. 2.
UNOE As defined in ISO 8859-5 : Information processing – Part 5: Latin/Cyrillic alphabet.
UNOF As defined in ISO 8859-7 : Information processing – Part 7: Latin/Greek alphabet.
UNOG As defined in ISO 8859-3 : Information processing – Part 3: Latin alphabet.
UNOH As defined in ISO 8859-4 : Information processing – Part 4: Latin alphabet.
UNOI As defined in ISO 8859-6 : Information processing – Part 6: Latin/Arabic alphabet.
UNOJ As defined in ISO 8859-8 : Information processing – Part 8: Latin/Hebrew alphabet.
UNOK As defined in ISO 8859-9 : Information processing – Part 9: Latin alphabet.
UNOX Code extension technique as defined by ISO 2022 utilizing the escape techniques in accordance with ISO 2375.

ISO-2022-JP character set

  • This code page allows the escape techniques in accordance with ISO 2375. The text starts in ASCII and switches to Japanese characters through an escape sequence. The bytes following the escape sequence are encoded in two bytes each
UNOY ISO 10646-1 octet without code extension technique.
KECA A to Z
0 to 9
. , – ( ) / = ! ” % & * ; < >

Windows 949 code page

  • Korean Syllables (2350 characters)
  • Korean Hanja (4888 characters)
  • Korean Alphabets
  • Characters and numbers enclosed in a circle
  • The length of the strings are counted by byte instead of characters. So if you have a data element of length 3, you can have 3 latin characters, 1 Korean character or 1 Korean and 1 Latin character!

Tags: BizTalk | EDIFACT | UNOB

In a previous project I worked with EDI message to interchange with partners, but before I send the message to the partner I have the need to pass then to o loopback adaptor, that was configured with EDISend pipeline and EDIReceive Pipeline.

The objective is to get some proprieties, configured in the Party, that I need to precede the orchestration.

The send work well and create a correct EDI message, but on the receive I expect a Edifact Interchange Message but when I receive back the message it gives the following error:

… Exception thrown from: segment -1, progress -1

Inner exception: Received unexpected message type ‘http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006#EFACT_D01B_INVOIC_EAN010&#8217; does not match expected type ‘http://schemas.microsoft.com/BizTalk/EDI/EDIFACT/2006/InterchangeXML#EdifactInterchangeXml&#8217;.

Exception type: UnexpectedMessageTypeException

Source: Microsoft.XLANGs.Engine …

SOLUTION

You have to configure the EDI pipeline to preserve the interchange.

In EDI Pipeline configuration:

  • On EDI disassemble component
    • Set the property “PreserveInterchange” to “True”
EDI Pipeline proterties

Tags: BizTalk | EDI | Errors and Warnings, Causes and Solutions