cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI Language converters

Former Member
0 Kudos

Dear Experts,

How to convert the languages in SAP PI from English to local country languages. ?

We have a requirement to convert the incoming English language to 3rd party applications language(say chinese).

Is this a standard availability in SAP PI or any customized beans to be deployed for conversion ?

I am New to SAP PI. Hence needed your help.

Thanks & Regards,

Y V P Deepak

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Deepak,

You should try encoding option

Former Member
0 Kudos

Hi Raghuram,

Thanks for the reply...

Its a good information about the conversion. Earlier i have different views in conversion.

Now it made me understandable what to do...

Will follow that useful information  and come back again if any help needed further.

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Hello Deepak,

By default there is no option.

as mentioned in the link you can do encoding using UDF or In the channel using beans.

Former Member
0 Kudos

Hi Raghuram,

Do language packs are necessary to install in SAP PI for encoding ?

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Hello Deepak,

For Encoding no need of any Packs to be installed.

But am not sure about API part which Inaki suggested.

Former Member
0 Kudos

Hi Raghu,

We are using receiver SOAP adapter for this language conversions with the below mentioned module configuration.

localejbs/AF_Modules/MessageTransformBean      Transform.ContentType       text/xml;charset=utf-8

AF_Modules/TextCodepageConversionBean          Conversion.charset             Cp273

AF_Modules/XMLAnonymizerBean                       anonymizer.encoding           Cp273

When checked the monitor messages in moni there is no code page encoded as expected.

Having little confusion, whether i am checking in a right way.

Please suggest us...

Thanks & Regards,

Y V P Deepak

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Deepak,

Do you want to say a payload translator?, i mean you have a tag in the XML <text>this is a text</text> and your want to translate for example in Spanish in the way <text>esto es un texto</text>?.

If you want that, i think you should consume an external API, may be google has one, like a webservice, at mapping level with a SOAP lookup for example:

Regards.

Former Member
0 Kudos

Hi Inaki,

Could you please give more about external API.

How to consume this external API?

Thanks & Regards,

Y V P Deepak

iaki_vila
Active Contributor
0 Kudos

Hi Deepak,

The API is not free for commercial purposes, check this link Translate API - Translate API &amp;mdash; Google Cloud Platform

You can consume the webservice with Rest or SOAP adapter.

Regards.

Former Member
0 Kudos

Hi Inaki,

Currently we are not supposed to consume the web API's.

Please suggest us to achieve this in a standard approach of coding page encoding.

We made a try but fails to achieve this scenario.

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Deepak did you try using the links which I shared.?

Former Member
0 Kudos

Hi Raghu,

We are using receiver SOAP adapter for this language conversions with the below mentioned module configuration.

localejbs/AF_Modules/MessageTransformBean      Transform.ContentType       text/xml;charset=utf-8

AF_Modules/TextCodepageConversionBean          Conversion.charset             Cp273

AF_Modules/XMLAnonymizerBean                       anonymizer.encoding           Cp273

When checked the monitor messages in moni there is no code page encoded as expected.

Having little confusion, whether i am checking in a right way.

Please suggest us...

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Hello Deepak,

Are you using this bean at the Receiver adapter level?

The encoding will be done after mapping.Check in RWB channel monitoring.

Former Member
0 Kudos

Hi Raghuram,

As per the links provided by you, i tried with java mapping. But not getting the results as expected.

My requirement is to convert the english language to Korean language.

Please suggest how to do by using the code pages.

Appreciated your help

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Deepak,

Post your Java code and also did you try with the module beans?

Former Member
0 Kudos

Hi Raghuram,

The below is the code

import com.sap.aii.mapping.api.*; 

import java.io.*; 

public class ChangeEncoding_JavaMapping extends AbstractTransformation { 

    @Override 

    public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException { 

        try { 

            InputStream inputStream = transformationInput.getInputPayload().getInputStream(); 

            OutputStream outputStream = transformationOutput.getOutputPayload().getOutputStream(); 

            //Read input as cp1252 and write output as UTF-8. 

            byte[] b = new byte[inputStream.available()]; 

            inputStream.read(b); 

            String inS = new String(b, "ISO-8859-1"); 

            outputStream.write(inS.getBytes("EUC-KR")); 

        } catch (Exception ex) { 

            getTrace().addDebugMessage(ex.getMessage()); 

            throw new StreamTransformationException(ex.toString()); 

        } 

    } 

and i tried with module beans at sender channel as mentioned below.

receiver channel type is File adapter. with standard module no conversion beans added.

when i tried with the above mentioned configuration. In RWB i am able to see as below mentioned screen shot.

but when i checked in the directory path the output looks like this.

Do i need to configure beans at receiver end ?

Thanks & Regards,

Y V P Deepak

Former Member
0 Kudos

Hi,

Any response from any one ?

Thanks & Regards,

Y V P Deepak

former_member186851
Active Contributor
0 Kudos

Hello Deepak

Use that beans and check the output in WS,it should convert.

Try it ..I will try to get the exact conversion for Korean language.

Former Member
0 Kudos

ok Raghu ...

I will try one more time...