BizTalk Mapping EDI N2 field (in an outbound message) - biztalk

What's the best practice for mapping decimals in EDI schemas?
The assembler seems to be flexible to allow them to be there or not.
I had one case on a QA system, where same map, but two customers were getting different results. I was thinking it had to be a party configuration option.
This is for outbound X12 EDI 210 (version 401)
Schema
Note on sample below: L102 is define as R, and L104-L106 are defined as N2.
L1*1*111.00*FR*11100****LHS~ (Correct)
L1*1*111.00*FR*111.00****LHS~ (Incorrect)
I was hoping the Party settings:
under Local Host Settings, checking the box for "Convert implied decimal format NN to base 10 numeric value" would fix, but later I read this is only for incoming EDI messages.
I did a test where I mocked up a 210 XML, just showing a fragment below with the results to the right side of L104-L106. This seems to show that if no decimal there, the two decimal places are implied, but if decimal is there, that overrides.
Sample1
<ns0:L1>
<L101>1</L101>
<L102>111.00</L102>
<L103>FR</L103>
<L104>111.00</L104> EDI Value 11100
<L105>111</L105> EDI Value 111
<L106>11100</L106> EDI Value 11100
<L108>LHS</L108>
</ns0:L1>
Sample 2
<ns0:L1>
<L101>1</L101>
<L102>111.00</L102>
<L103>FR</L103>
<L104>111</L104> EDI Value 111
<L105>111.0</L105> EDI Value 11100
<L106>111.00</L106> EDI Value 11100
<L108>LHS</L108>
</ns0:L1>
So two questions:
1) Is there a party setting to fix my issue where one customer is right and one is wrong?
2) What is the best practice for mapping decimal places in the BizTalk supplied XML/EDI schemas?

Related

Create bitmap file and send it to a client

I need to create a bitmap file with below specification and send it to client using BizTalk
BIT NAME Attribute Length
- Msg Type n 4
- Bit map b 64
1 Bit map, Extended b 64
2 UniqueID n …19
7 Transmission Date and Time n 10
This is the first time I am working with bitmap fields.. Can someone provide me the example of the records as per the above bitmap fields specification.
And how do we send the record using biztalk..like which piepline should we use.
It looks like a positional flat file.
So create a positional flat file schema and use a flatfile pipeline.

BizTalk macro for datetime with 12 digit date

I want the macro to use send port to generate a file with file name Timestamp must be 12 characters in length
eg: 201904060232_testfile.csv
I tried to us %datetime_bts2000% but it have 15 digit.
can anybody help me here?
Here is a list of all the Send Port Macros. BizTalk Server: List of Macros
Unfortunately there isn't one that matches what you want, but the usual work around is to set the File.ReceivedFileName property (either in an Orchestration or using BRE Pipeline Framework) and use the %SourceFileName% macro.

A catch 22 in generating 999 file

Well, I have to say it is kind of funny when I meet this situation:
I am inbounding HIPPA 837 files and I am suppose to create 999 ACK files once received the 837 file. BizTalk will generate the 999 message if I setup the trading partner agreement to do so. And it works fine so far.
Today, I received a 837 file with some structure error: there are some leading space character in an element. Then the 999 was created, but when my send port subscribe this 999 message try to save it as a file, I got an validation error complains the 999 message itself is invalid cause its element have leading space characters.....
Error: 3 (Field level error)
SegmentID: IK4
Position in TS: 18
Data Element ID: IK44
Position in Segment: 4
Data Value:
6: Leading or trailing space found
It looks for me like a catch 22: your 999 files are suppose to report structure error of the inbound file,it will include the wrong element value as part of the report (in my case, it's in IK4 segment) , but the wrong element value itself make the 999 file invalid too.
I just want to know if anyone have meet the same situation? And what's your suggestion on this issue?
I have not seen this, and really, I'm a bit surprised it hasn't come up before, if it's a real catch-22 :)
Try this, in the You->Them tab of the Agreement, set the Default row in the Validation section to have Leading and trailing spaces = Allowed.
You may have to explicitly set all other tx to Not Allowed since the 999 is not on the Transaction Type list.
I would try #Johns-305's suggestion, but I know I've had issues with using the allow leading/trailing spaces before in the agreement (some fields just seem to blow up on this for me even with it on).
I would try capturing the 999 message before it gets to the EDI send and using normalize-space() (in XSLT) or .Trim() (in C#) on the node(s) in question. You can do this by creating a send port that filters on the 999 BTS.MessageType.
This may not fully satisfy your trading partner's expectations though, because the segment might be valid without a space (leading to confusion about why a perhaps otherwise valid segment was rejected).
You also might take this up with Microsoft, although it might be a limitation of using XML (where leading whitespace may be treated as insignificant) to represent EDI (where leading whitespace is bad news).

Extra char(s) found in EDI.ISASegment

When I was inbounding trading partner's X12 file using biztalk. I am required to store the ISA segment of the file in a db table.
I am using the promoted property EDI.ISA_Segment to get the ISA string.
Recently, I noticed for one trading partner. There're extra chars found in the ISA segment:
The ISA segment shall look like this:
ISA*00* *00* *ZZ*######## *ZZ*##### *150105*0606*^*00501*000000936*1*P*>~
But the ISA_segment using the promoted property was:
ISA*00* *00* *ZZ*######## *ZZ*##### *150105*0606*^*00501*000000936*1*P*>~
G
There's extra < LF >+G in the ISA segment.
The trading partner do send the X12 file with segment suffix and it was also configed in the BizTalk Agreement correctly.
It looks BizTalk takes 2 extra chars to the ISA_segment after reached the "~", I am wondering if this is a bug or it is caused some mis-configuation?
You need to look at the original EDI using a good text editor such as Notepad++ so you can see exactly what those characters are.
The X12 spec allows the use of CR and/or LF as part of the Segment Terminator so it might be a side effect of changing encodings from EDI to the database.

Some special characters are added in the BizTalk output file

I have put an XML into a receive location using the Microsoft BizTalk default pipeline "XMLReceive" and then use PassThroughTransmit to output the file to a directory.
However, if hex editor to check the output file, I found that there are three special characters  are found at the beginning of the output file.
The ASCII of  is EF BB BF.
Is there any idea why there are 3 control characters are added at the beginning of the output file?
Those characters are the Byte Order Mark which tell the receiving application how to interpret the text stream. They are not junk but are optional.
I recommend you always send the BOM unless the recieving system cannot accept them (which is really their problem ;).
I have googled the solution myself and shared to others.
Removing the BOM from Outgoing BizTalk Files
http://mindovermessaging.com/2013/08/06/removing-the-bom-from-outgoing-biztalk-files/
The three special characters are BOM (Byte Order Mark), set the PreserveBOM to false in sendport XMLTransmit pipeline will remove these three characters.

Resources