on 01-12-2015 5:15 PM
Hello All,
Our message mapping is failing due the special character like % sign in the payload.
What is the recommended best practice in SAP PI for handling special characters in payload. ?
The sample XML column is shown below.
<NameofJob>ABC XYZ (10%)</NameofJob>
Thanks,
Kiran
A % is not a special sign and need not treated specially.
Could you post the error message which you receive, when the mapping is failing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stephen and Raghu,
The following is another example of the payload
<MaterialDescription>ROUND BOX 2-3/8" X 10</MaterialDescription>
The following is the error
Thanks,
Kiran
<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_WorkOrderStatusUpdatePublish2Updat~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #3 not allowed in Character~</SAP:Stack>
Kiran,
It is highly recommended to request the sender system, to fix the code and generate well-formed XML. I agree with
As last option, follow the solution Not well-formed XML - & issue.
Hello Stefan & Raghu,
We have the following process. The user enters the following text.
The ECC process then calls a PI service via consumer proxy and the following payload is sent to PI
<MaterialDescription>ROUND ALUM DIGN POST 2-3/8" X 10</MaterialDescription>
Can you please let me know where this transformation is happening ?
Thanks,
Kiran
Kiran,
It seems ABAP proxy (SAP) is not following W3C standard.
' should be represented as ' if it is present in data. Ask ABAP team to fix it.
If they can't, implement Java mapping mentioned in the blog 'Not well-formed XML - & issue'. Use this replace logic,
replaceAll("", "'"); OR replaceAll("", "'"); // replace with ' or '
FYI.
Link.
There are 5 predefined entity references in XML:
< | < | less than |
> | > | greater than |
& | & | ampersand |
' | ' | apostrophe |
" | " | quotation mark |
Is your ECC not a unicode system? In that case your connection settings are not correct. Check it.
I wonder which character was entered by the user. An apostrophe should not cause any issues. Maybe it is an accent like ´ or ` ?
By the way: Within an XML element, an apostrophe need not be escaped. Only two characters must be escaped: < and &
Hi Stefan & Raghu,
Our SAP system is not Unicode enabled but SAP PI is Unicode enabled. I was looking into the SM59 connection to our XI box from ECC and I found the following info.
I also verified that the special character is an apostrophe and not an accent.
With the current set up is Java Class in Operation Mapping the only way to handle this issue ?
Thanks,
Kiran
I have no idea how to solve it. An apostrophe should not cause trouble.
I cannot imagine how an apostrophe becomes ascii value 3. That makes no sense.
As the sender is an ABAP proxy, I think the issue is in the ABAP code.
It is hard to giva an advice without looking into the system.
Of course a Java mapping could replace the value, on the other side: when apostrophe becomes a wrong value, I assume that many other characters become wrong values as well.
Kiran,
FYI. HTML-code of ' is ' and End of Text is 
The ABAP report program, where user is entering data is not storing data properly to SAP database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.