cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PO 7.5 - Encoding Issue with Byte Order Mark in File Sender Channel with fixed lenght.

Sheep2001
Explorer
0 Kudos

Hi Folks,

I need your assistance. I have a file scenario, where I read a flat file (fixed lengh) from filer using MTB and send the data via ABAP Proxy to ERP system.

The file itself, seems to be encoded in UTF-8. However in the first record of the file, the first field which has a fixed lenght of 3 is always shifted one digit to the right, see picture.

aif1.png

I think this is because of the Byte Order Mark. My channel config is a follows:

pochannel.png

is there any solution to remove the byte order mark?

i havent found one in SAP community.

Thanks

peter_wallner2
Active Contributor

Hi, I am not sure if you can remove the byte order mark with the MTB standard module, you might have to go with a custom adapter module and check for an UTF8 BOM and remove it if you find one. There is an adapter module that adds a BOM: https://github.com/viksingh/PIAdapterModuleAddBom/blob/master/AddBomBean.java - use that as a guideline and instead of adding you remove it

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

If you use the file adapter, you could remove the BOM with a line command.

I found this for UNIX:
https://stackoverflow.com/questions/45240387/how-can-i-remove-the-bom-from-a-utf-8-file

Answers (1)

Answers (1)

Sheep2001
Explorer
0 Kudos

Thanks Peter, we will look into that, it seems this is the only possibility to remove the BOM. As it already needs to be removed before converting into XML

peter_wallner2
Active Contributor

Hello Patrick, I agree, it seems crazy to make a custom module for that but I remember I had done this before but I can't find the java code anymore. yes, before you XMLize the payload that is the only way to do it or with a line command like Stefan suggests.