Skip to Content
avatar image
Former Member

scenario is proxy to jdbc while response getting error MAPPING">EXCEPTION_DURING_EXECUTE occured .

Hi Experts ,

My scenario is proxy to JDBC,Where request is going to target system and we are getting response  successful but some special character are comming in the response   .

Below is the error  in monitor .




  <SAP:P3>Character reference "&#xd83d" is an invalid XML ch</SAP:P3>


  <SAP:AdditionalText />

  <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_mm_get_lista_res_to_res_; reference &quot;&amp;#xd83d&quot; is

After analyzing the response we found response is comming wih some special character like below

  <MESSAGEFORGUEST>Para ajudar aos amigos e familiares segue a lista dos nossos sonhos para nossa casa                  </MESSAGEFORGUEST>

I am attached the screen shot also for error reference.

How to handle the above special character in PI or is there any option to  handle in ECC system.

Please help us to solve the issue.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Jan 06, 2015 at 01:18 PM


    Sender system should send well-formed XML. w3c Link. It is highly recommended to fix this in sender system. I agree with Former Member and Former Member. If it can't be fixed in sender system, please implement below solution.


    1) In OM select below Java mapping before MM.

    2) Tweak the logic, if needed. It is difficult write generic logic as & is Predefined Entities of XML.

    package com.javaMapping;
    public class Wellformed_JavaMapping extends AbstractTransformation {
        public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {
            try {
                InputStream inputstream = transformationInput.getInputPayload().getInputStream();
                OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
                // a) Copy Input content to String
                byte[] b = new byte[inputstream.available()];
                String inputContent = new String(b);
                // b) Replace & with &amp; Use this when every & in input is not escaped as &amp;
                inputContent = inputContent.replaceAll("&", "&amp;");
                // Use this when a few & are escaped as &amp; and a few & are not escaped. This logic will avoid &amp; to become &amp;amp;
                //inputContent = inputContent.replaceAll("&amp;", "____someTEXT_____").replaceAll("&", "&amp;").replaceAll("____someTEXT_____", "&amp;");
            } catch (Exception exception) {
                throw new StreamTransformationException(exception.toString());
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 12:14 PM

    Hi Ravi,

    did you try to test the response message mapping with payload (by view source)? Please check if it is because of special char or any other operation/function in message mapping.



    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 12:40 PM

    Hi Ravinder,

    You will need a previous java mapping to omit the special characters. Check this doc: Implementing a Java Mapping in SAP PI to remove Escape Sequences from a file


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Harish,

      Thanks for  the replay.

      I tested the response using view source the above error is due to the special character only.

      If go for java mapping need to maintain the all the special character in the code level right?

      if we maintain some range only these special character some Brasil language we can not avoid the using java mapping Is there any note for the above  issue.



  • Jan 05, 2015 at 01:33 PM

    Hi Ravinder,

    I can notice that your sender system is an ABAP one, you can try to set the connection to unicode like this note explains: 1768901 - PI mapping runtime ParserException

    The java mapping solution can be use to determine what character to accept, easier than to set the erroneous (like this other Dubey Sachi's example Special character’s handling in PI/XI simplest ever.). The Portuguese characters should be accepted in the mapping, i think the problem is with a special control one.


    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 03:00 PM


    This is not a problem with language characters. It seems Unicode (UTF-8) representation of Emoticons are not properly escaped in XML.

    1) Please download the payload from MONI and save it as .txt file.

    2) Open the payload with notepad++ or foxe editor.

    3) Paste the screenshot here in the SCN, where MESSAGEFORGUEST is present. We would be able to help.

    FYI. In XML &, <, >, ; ,' should not be present in XML data, without escape sequence. Link.

    Emoji Link.

    Portuguese.PNG (56.5 kB)
    Add comment
    10|10000 characters needed characters exceeded