cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to set encoding (UTF-8 etc) in Proxy

Former Member
0 Kudos

Hi All,

I have a sceanrio where SAP is sending data using proxy to XI. In SAP some of the descriptive fields contains special charaters. Now when this data comes to XI, my mapping fails, showing XML parser exception.

One of the way i understand is to try different encodings like UDF-8, UDF-16 etc, but thats only possible in File adapters. However in my scenario the data is coming from SAP using Proxy.

So how do i go setting up encodings for Proxy?

Any Idea.

Regards,

Xier

Accepted Solutions (0)

Answers (3)

Answers (3)

henrique_pinto
Active Contributor
0 Kudos

It's strange that there is a parser exception.

Usually, you'd set the encoding for the receiver side to be able to understand the message, but XI should have no problems at all (since ABAP Proxy runtime generate UTF-8 messages by default).

Could you let us know which is your exact problem?

Regards,

Henrique.

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

What is the kind of mapping you are using?

and can you paste the payload in to the Test tab and check whether it runs in it properly or not?

btw the encoding is default UTF-8 which will support maximum languages/special characters, just chk ur xml structure first.

Ranjit

Edited by: Ranjit Deshmukh on Feb 19, 2008 10:52 AM

Former Member
0 Kudos

Thanks for the reply guys,

I am not to sure if CDATA will work, cause CDATA will come in the mapping, however I am getting XML parser error, that means the message is failing before it goes for mapping.

Also when i paste the proxy xml structure formed in SXMB_MONI, in Message Mapping 'Test' tab, and when I press tab which aligns the xml propely (like pretty printer) it gives a error that xml could not be formed (XML Parser error).

Regards,

XIer

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

this is exactly what I suspected.

can you paste your xml here?

lets see what special characters you have and as far as i know that is not the problem, but the problem is with the xml structure.

And so, please paste the error that you get in moni.

Ranjit.

Former Member
0 Kudos

Yes my scenario is from SAP(Proxy) to Database(JDBC). The data in SAP came from a conversion run, and during conversion run some of the charaters like '==>' was stored in SAP as '□□□□' . So when the interface is run from SAP '□□□□' also comes along. and the mapping fails giving the error 'XML Parser Exception'. Process teams wants us to transmit the data the way it is in SAP, even if it contains special charaters.

I don't have the xml right now. Will paste it tomorrrow.

But when i remove '□□□□' from XML found in SXMB_MONI and then run that XML from RWB 'Send Message' Tab the data passes to the receiver end smoothly.

So i am sure '□□□□' is causing the XML parser error.

Regards,

XIer

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

As far as i think the representation of '==>' will be and should be '==&''gt;' (neglect '')

this should the same representation in ECC also after the conversion run.

please check the conversion run output.

And one more thing, the characters that you have pasted are representation of the white box character(its HTML representation is &'#9633;)(neglect ' )

refer: http://www.fileformat.info/info/unicode/char/25a1/index.htm

Neverthless it would be easy to see your xml here.

Ranjit

Former Member
0 Kudos

Here's the XML,

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_CapitalOrderHeader xmlns:ns0="urn:sce-com:xi:fi:OrderHeader">

<MessageHeader>

<SystemOfOrigin/>

<InterfaceID/>

<ProcessArea/>

<OtherArea>

<Identifier>

<Name/>

<Value/>

</Identifier>

</OtherArea>

</MessageHeader>

<MessagePayload>

<Record>

<OrderNumber>000800059790</OrderNumber>

<CompanyCode>2001</CompanyCode>

<CostCenter>H200525</CostCenter>

<WBSElement/>

<WorkOrderType>EDNS</WorkOrderType>

<AssetLocation>6079</AssetLocation>

<CreatedDate>20080125</CreatedDate>

<ReleasedDate>20080125</ReleasedDate>

<ScheduledStartDate>20080125</ScheduledStartDate>

<ScheduledFinishDate>20080126</ScheduledFinishDate>

<UserStatus>APVD ZCPR</UserStatus>

<TecoDate>00000000</TecoDate>

<CloseDate>00000000</CloseDate>

<SystemStatus>REL MACM PRC SETC</SystemStatus>

<ShortText>6979-2310-52132</ShortText>

<LongText>

<TdLine>6979-2310-52132</TdLine>

<TdLine>FLORES INVESTMENTS</TdLine>

<TdLine>P.O. BOX 996</TdLine>

<TdLine>LA QUINTA CA 92253</TdLine>

<TdLine>X17260E,ON RSB, 2 RAP</TdLine>

<TdLine>52132,R15 COMM 3P LINE EXT ASSOC AI S6968</TdLine> </LongText>

<ReasonCode>2SK</ReasonCode>

<CreatedBy>LSMWI02100</CreatedBy>

</Record>

</MessagePayload>

</ns0:MT_CapitalOrderHeader>

Also I checked in SAP tables the data there too is <TdLine>52132,R15 COMM 3P LINE EXT ASSOC AI S6968</TdLine> .

So I think we will have to write some code in the Proxy itself. Cause CDATA in MApping wont help as we get XML parser error before mapping step.

Could someone tell what code needs to be written in ABAP Proxy to tackle this issue...

Regards,

XIer

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

It seems that you have a control character in your payload, and as far as i know the xml parser will fail while converting this control character(as in test tab it fails)

representation for is '1A' (I found this using Hex Editor- correct if i am wrong)

And I think proxy allows the control chars to be sent to XI.

check this discussion:

You say that the contents in ECC are required as they are in the target side, but can you confirm do they really want these control characters also as contents?

If not you can get rid of them in the proxy execute method itself.

And yes you were asking how to change encoding right?

here is how I did that using java mapping:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder documentBuilder = factory.newDocumentBuilder();

Document input = documentBuilder.parse(in);

OutputFormat format = new OutputFormat(XML, "EncodingYouWant", false);

XMLSerializer serializer = new XMLSerializer(out, format);

serializer.serialize(input);

you will need some jars to support above code, you can download them for free.

Hey and can you paste the parser error that u get in Moni?(while pasting it here please right click on the error window select view source and then paste it here-this for more care)

Ranjit

Former Member
0 Kudos

Guys even after follwoing up on this issue so much, I guess we don't have definative solution on this issue.

But i am still surprised that there is no way of handling special charaters coming from SAP through proxy????

XIer

stefan_grube
Active Contributor
0 Kudos

Please check out, where the ===> comes from and how you can avoid the illegal values.

This is not related to a code page or UTF-8, it is simply a charcter issue.

Regards

Stefan

aashish_sinha
Active Contributor
0 Kudos

Hi,

I am agreed with stefan, it's just a character issue nothing related with UTF. I have one suggestion, if that charcter is not of much importance just remove it with some other place holders like space.':' or anything else using UDF or just in graphical mapping. also with the help of advance UDF, you can merge whole long text data into one string and then replace the special characters from that string and then map it to target location.

Regards

Aashish Sinha

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

is your problem solved?

if so can you please close this thread?

Ranjit

justin_santhanam
Active Contributor
0 Kudos

Hi,

As said by Henrique in the below thread, can u try by using CDATA? I'm not sure if it helps u, just give a try.

He suggested for Java Proxy, I don't know how well it holds for ABAP Proxy.

raj.