cancel
Showing results for 
Search instead for 
Did you mean: 

Converting the file format from UTF-8 to ANSI in SAP PI

Former Member
0 Kudos

Hi,

We have an interface in PI system which is having the data flow as below.

SAP ERP -> SAP PI -> MQ -> Third party system

SAP ERP is sending an XML file to SAP PI.

PI is converting the XML file into text file UTF-8 format and passing the data to MQ folders.

MQ system is copying the files from their folders to Third party folders.

Third party team needs the file in ANSI format instead of UTF-8 format.

MQ team cannot change the file formats as it effects other interfaces as well.

So we need to change the text file format in PI system only.

Could you please provide some suggestions to convert the file format from UTF-8 to ANSI in PI.

Regards

Abdul Samee

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

We have tried to perform the various options in PI system.

But the file was still going in UTF-8 format only.

Instead of performing the changes in PI system our MQ team agreed to change the file format in their system.

Now the file is transferred to the third party system in ANSI format.

Thank you for all the suggestions.

Regards

Abdul Samee

stefan_grube
Active Contributor
0 Kudos

How is the text format created? Is it done by MessageTransformBean? Then you can apply the target encoding to the parameters there.

Are you using Websphere MQ? Then you can write the target encoding in CCSID parameter.

The XMLAnonymizerBean is designed for XML messages, you cannot use it for your purpose.

There is no codepage called ANSI. ANSI =  American National Standards Institute

You have either cp1252 or iso-8859-1. Ask your team lead or team memebers for the correct encoding. This is nothing to guess.

Former Member
0 Kudos

Hi Stefan,

Input to PI is an XML message from SAP ERP.

In PI we have an XSLT mapping for converting the XML file to Text file.

stefan_grube
Active Contributor
0 Kudos

You could add

<xsl:output method="text" encoding="cp1252" ...


to your XSLT


you can use TextCodepageConversionBean in your JMS channel


Adding TextCodepageConversionBean in the Module Processor - Adding Modules to the Module Processor -...



Former Member
0 Kudos

Thank you Stefan.

I will check this option.

anand_shankar10
Active Participant
0 Kudos

you do have one more option. may be the easier one is that in both the adapter you can specify the Unicode and then it will create a file in ansi.

in sender adapter mention the uniocde as UTF-8 and in receiver adapter mention it for ANSI.

refer: http://scn.sap.com/message/6518701#6518701

Former Member
0 Kudos

Hi Anand,

I am using JMS adapter at the receiver communication channel.

anand_shankar10
Active Participant
0 Kudos

using OS command in receiver channel will be helpful.

Thanks

Former Member
0 Kudos

Hi anand,

Can you please some more info on how can we use the OS command at Receiver comm.channel.

anand_shankar10
Active Participant
0 Kudos

I am not expert in OS commands but you can google out.

try with

iconv -l | grep -I ansi

search for options in command or someone from our group can let you know.

You have to enter this OS command in receiver channel.

Regards

Anand

azharshaikh
Active Contributor
0 Kudos

Hi Abdul,

You can perform the Encoding conversion for XML using SAP Standard Module: XmlAnonymizerBean

1     AF_Modules/XMLAnonymizerBean     Local Enterprise Bean     anonymizer

anonymizer          anonymizer.encoding     (Enter Required UTF Encoding)

ASCII is a subset of UTF-8, so you cannot convert UTF-8 to ASCII without loosing information. Please check the required Encoding from the 3rd Party.

Regards,
Azhar

Former Member
0 Kudos

Hi Azhar,

Can i use this AF_Modules for getting ANSI format as well.

While providing the encoding value do I need to use 1252 (ANSI codepage) or iso-8859-1 .

Please suggests.

azharshaikh
Active Contributor
Former Member
0 Kudos

Thank you Azhar.

I will check this encoding conversion.