on 03-23-2016 8:39 AM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
The API is not free for commercial purposes, check this link Translate API - Translate API &mdash; Google Cloud Platform
You can consume the webservice with Rest or SOAP adapter.
Regards.
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.