1
votes

Do you know how I can set UNB in EDIFACT?

I have a CSV input file:

VRD1;100;200;0;0;L

And the output should be:

UNA:+.? '           
UNB+UNOA:2+100:14+200:14+200305:0704+00000000000000++AAA'           
UNH+1+INVRPT:D:96A:UN:EAN005'           
BGM+10::9+20200305070403+9

I have to map the second and third fields to UNB.

I appreciate any help in this regard. Thank you in advance.

1

1 Answers

0
votes

You should be able to do this using the EdiOverride message context properties. You can find them in the Microsoft.BizTalk.Edi.BaseArtifacts assembly found in the BizTalk Server installation folder.

For instance, in an orchestration, you can do this:

EdifactMessage(EdiOverride.OverrideEDIHeader) = true;
EdifactMessage(EdiOverride.UNB2_1) = xpath(CsvMessage, ...); // 100
EdifactMessage(EdiOverride.UNB3_1) = xpath(CsvMessage, ...); // 200

Add a correlation set with the same properties to your send shape.

If you want to set them in a pipeline, use the property namespace http://schemas.microsoft.com/BizTalk/2006/edi-properties.