cancel
Showing results for 
Search instead for 
Did you mean: 

Save File in ANSI after the file is generated.

Former Member
0 Kudos

Hi,

I have requirement to save a file that is generated as an UTF-8 encoded file (via File Adapter) in ANSI format.

Here is the background:

End to End Scenario: Idoc to File (ECC--> PI --> NFS folder path --> Database system (Oracle based Database) )

Now the Database system in a non-unicode system. The file I am generating in PI is a UTF-8 encoded file. It contains special characters (Lithuanian Characters) in it. Now since the Database system in a non-unicode system, the file generated in PI is unable to be loaded into their system.

The code page accepted in the database cp-1252. and they need us to send the file in ANSI format.

Here is the problem: when I use a Code Page 1252 in my adapter, the Lithuanian Special Characters get replaces with "?" or "#". To retain the special characters, i need to use UTF-8 encoding in my adapter. Now when I save this file generated with UTF-8 on my local desktop and save it in ANSI Mode, then the database system is able to load the file.

In the screenshot below, highlighted in Maroon is the file saved as ANSI on my local desktop, which the database system is able to load.

Is there any way to automatically generated this ANSI File. I have seen the "Run Operating Command Before/After processing" option in Adapter, but I don't know if we can use this for my case. If we can, how do I use it.

Please Note: I have used all the encoding formats SAP suggests in my adapter, but it did not help.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member2987
Active Contributor
0 Kudos

Hi Lakshmi,

Interesting question. Not exactly something I've seen, but I have had to inter face with some PI feeds in the past.  I'd say the easiest thing to do eke the data in a Unicode system for as long as possible. Can you have the PI job put the data in a "Z" table in the IDM database? Otherwise you might need to do some scripting when creating or reading the file to translate those characters from the ANSI format to the UTF format.