Skip to Content

how to remove special char

Dear Guru;

my scenario is abap proxy to jdbc async. and Error occured with the following special char

when executing application mapping program com/sap/xi/tf/_MM_JM_Remove_ECC2LEGACY_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Character reference "&#x10" is an invalid XML character.

i am trying to make java mapping to solve it,  but i realized that there is nothing to do in java mapping

because error on the following 3 step  , it seems to be not reading inputStream with '&#x10'.

how can i do with this issue ?

Ready to Java mapping

1. Document Builder Factory Created

2. Document Builder Created

[Fatal Error] :5:198: reference char "&#

com.sap.aii.mapping.api.StreamTransformationException: reference char "&#

at JM_Remove_Send.execute(JM_Remove_Send.java:224)

at JM_Remove_Send.main(JM_Remove_Send.java:71)

public void execute(InputStream inputStream, OutputStream outputStream)
   throws StreamTransformationException {

  System.out.println("Ready to Java mapping");

   try {
 
   //------------------------- 1. step --------------------------------//
   // create a DOM parser and parse input to create document tree


   DocumentBuilderFactory factory =
   DocumentBuilderFactory.newInstance();
   System.out.println("1. Document Builder Factory Created");
 

  //------------------------- 2. step --------------------------------//
   DocumentBuilder builder = factory.newDocumentBuilder();
   System.out.println("2. Document Builder Created");
 

  //------------------------- 3. step --------------------------------//
   Document doc = builder.parse(inputStream);
   System.out.println("3. Document Created");

please help me.

thanks you in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 02, 2015 at 06:16 AM

    If possible, I think special charaters are should be removed by sender ERP system and removed easily in ABAP source level.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 02, 2015 at 06:57 AM

    Hi David,

    If you use the DOM parser in your java mapping you will get the same exception that in the message mapping, you have to deal with the payload like byte stream. Check this document Java Mapping: To change the encoding type or replacing special characters.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 02, 2015 at 05:20 PM

    David,

    First we need to identify the special character.

    1) Download the XML before the message mapping. Right click on payload, download and save file with .txt extension.

    2) Open that file with foxe editor.

    3) Please select the special character in foxe and right click 'char Unicode'.

    4) Please post the screenshot here, special character in foxe.

    Add comment
    10|10000 characters needed characters exceeded