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 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, a good example is:
Data Element ID: FTX01
Data Value: ZZZ
12: Invalid value in data element
To solve this problem you must add this code to the list of the FTX01 element in the schema
The last week when I was trying to validate EDI message, provided by my partner, against the schema using Visual Studio, I kept getting this error:
” Invoking component…
C:\TestFiles\myEDIsample.txt: error BEC2004: Non Segment level :  Transaction Set or Group Control Number Mismatch “
This is a very basic mistake, and usually occurs when dummy messages are delivered to us for testing.
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+1000101'
This error is a notification that there is a mismatch with the transaction set or group control numbers. That’s nothing wrong with your project, the problem is actually in the message that you are using and if you look carefully at UNH and UNT segments, you will find the problema.
UNH Segment: This is the Message Header segment of an EDIFACT document. The UNH segment elements provide information about the message type, and the agency responsible for maintaining the publication of the message type. This segment indicates the start of a document in an interchange and the type of document that follows.
The firs element of UNH segment is:
- 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 UNT Segment.
o In the sample message this value is: 1000100
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.
- In the sample message this value is: 1000101
So the problem is that in the sample message the Message Reference Number in UNH segment is different from that exists in UNT segment.
Message Reference Number in UNH segment must be equal to the existing in the UNT segment. Therefore change one of them to become equal and the problem will be solved.
Other interesting resources: