Runtime mapping error due to the special characters in source XML

Hi All,
I am facing problem with the special characters coming in the source XML message. it is failing at runtime in the mapping level. when i test with the same XML message manually in graphical message mapping it works.
it looks like a UNICODE problem which we face noramlly in ABAP as well. but looking for a solution.
For your reference i am giving the data which i am recivieing and the error message below.
the problem is with the character .
Source payload error:-
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
An invalid character was found in text content. Error processing resource 'file:///C:/WINNT/profiles/CG1009/Local Settings/Temp/a173eb8_2721HTML000003'. Line 26, Position 22
Early response is appreciated.
Thank you

If your message contains special chars and the encoding is not being set, then the error is of the system which is sending the message, not XI's. The webserver should return the correct encoding.
At adapter engine, You can set the enconding for the messages you send (for example, in Soap adapter module, set XMBWS.XMLEncoding parameter with value iso-8859-1),  but not for the messages you receive.
As a workaround, you could try using a Java Mapping to change the encoding manually. For that, set the encoding of the OutputFormat of the XML you'll serialize. Try the following code piece for the mapping (inside a try/catch declaration):
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
Document input = documentBuilder.parse(in);
OutputFormat format = new OutputFormat(XML, "ISO-8859-1", false);
XMLSerializer serializer = new XMLSerializer(out, format);
serializer.serialize(input);
For that code to work, you'll need to import xercesImpl.jar and xml-apis.jar in Imported Archives of mapping objects, in Integration Repository. Both are available at http://xerces.apache.org/xerces2-j/ .
Regards,
Henrique.

Similar Messages

  • Error during data load due to special characters in source data

    Hi Experts,
    We are trying to load Billing data into the BW using the billing item datasource. It seems that there are some special characters in the source data. When the record with these characters is encountered, the request turns red and the package is not loaded even into the PSA. The error we get in the monitor is something like
    'RECORD 5028: Contents from field ****  cannot be converted into type CURR',
    where the field **** is a key figure of type currency. We managed to identify the said record in RSA3 on the source system and found that one of the fields contains some invalid (special) characters that show up as squares in RSA3. The data in the rest of the fields, including the fields mentioned in the error  looks correct.
    Our source system is a non-unicode system wheras the BW system is unicode enabled. I figure that the data in the rest of the fields are getting misaligned due to the presence of the invalid characters in the above field. This was confirmed when we unassigned the field with the special characters from the transfer rules and removed the source field from the transfer structure. After doing this the data was loaded successfully and the request turned green.
    Can anyone suggest a way to either filter out such invalid characters from the source data or make some settings in the BW systems such that the special characters are no longer invalid in the BW system? We cannot write code in the transfer rules because the data package does not even come into the PSA. Is there any other method to solve this problem?
    Regards,
    Ted

    Hi Thad,
    I was wondering, if system is unicode or non unicode that should not matter the amount and currency field . As currencies are defined by SAP and it is in pure English at least a currency code part of 3 Chars. 
    Could this because of some incosistency of data ??
    I would like to know for Which currency  had some special characters it it in that particular record ??
    Hope that helps.
    Regards
    Mr Kapadia

  • How to escape or remove the special characters in the xml element by regula

    Hi members,
    How to escape or remove the special characters in the xml element by regular expression  in java??
    For Example ,
    <my:name> aaaa </my:name>
    <my:age> 27 </my:age>
    In the above example , i have to retrieve the value of the <my:name> Element(For examlpe -- i have to get "aaaa" from <my:name> tag)...
    How to retreive this value by using DOM with XPATH in java
    Thanks in Advance

    Hi members,
    I forget to paste my coding for the above question....This is my coding......In this display the error...... Pls reply ASAP.......
    PROGRAM:
    import java.io.IOException;
    import java.util.Hashtable;
    import java.util.Map;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    import javax.xml.parsers.*;
    import javax.xml.xpath.*;
    public class DOMReaderForXMP {
         static Document doc;
         static XPath xpath;
         static Object result;
         static NodeList nodes;
         public DOMReaderForXMP() throws ParserConfigurationException, SAXException,
                   IOException, XPathExpressionException {
              DocumentBuilderFactory domFactory = DocumentBuilderFactory
                        .newInstance();
              domFactory.setNamespaceAware(true);
              DocumentBuilder builder = domFactory.newDocumentBuilder();
              doc = builder.parse("d:\\XMP.xml");
              XPathFactory factory = XPathFactory.newInstance();
              xpath = factory.newXPath();
         public static void perform(String path) throws Exception {
              result = xpath.evaluate(path, doc, XPathConstants.NODESET);
              nodes = (NodeList) result;
         public void check() throws Exception {
              perform("//my:name/text()");
              if (!nodes.item(0).getNodeValue().equals("application/pdf")) {
                   System.out.println("Mathces....!");
    ERROR:
    Exception in thread "main" net.sf.saxon.trans.StaticError: XPath syntax error at char 9 in {/my:name}:
    Prefix aas has not been declared

  • Mapping error while downloading the condition records (ECC to CRM)

    Hello Experts,
    We were downloading the condition records from ECC to CRM system (Production), but due to Mapping error, it was unsuccessful, i wonder what's going wrong there.
    When i see in SMQ2 (CRM Inbound Queue), an queue got stucked there, i.e, R3AD_ZDNL_COND_A930 having SYSFAIL status.
    While debugging the queue, I have found that the queue got stuck because of u2018Mapping Erroru2019.
    I found inside, Standard code reads the record from table /SAPCND/T681 (Condition Table Structure) for KAPPL = 'CRM', KVEWE = 'PR', KOTABNR = 'CUS930' and AS4LOCAL = u2018Au2019 for which the value of VAKEY_OFFSET is maintained as 0.
    If system finds the value of VAKEY_OFFSET is Zero(0) then it will change the download type from D (Delta) to M (Mapping Error) and raise the error & block the Inbound Queue in CRM.
    I checked in SMW01alsofor getting some more knowledge about that queue, here the error description:
    Structure information for table CNCCRMPRCUS930 not available (Message class: CND_MAP)
    Error when carrying out delta download (Message class: CND_MAP)
    I am a technical guy and dont have much idea in CRM Middleware.
    I welcome your valuable thoughts and will award full points.
    Regards,
    Jeo

    Hi,
    As you mentioned i checked for the followings:
    >>In Maintain field catalog:
    I found only 2-3 fields are maintained here, when i compared with A930 (A930 in ECC system).
    >>Create condition tables:
    I checked it for CUS930, i found the same but condition table structure name like CNCCRMPRCUS930 are missing. Is that important? Because i see in SMW01, same error is coming over there : Structure information for table CNCCRMPRCUS930 not available .
    Please suggest me, now what i need to do?
    Regards,
    Jeo
    Edited by: Jeo Denson on Dec 1, 2011 4:11 PM

  • What are the special characters?

    Hello,
    I am doing the dreamweaver tutorial that comes with
    Dreamweaver 8 and so far I have done everything by the book and I
    am getting an error when trying to insert a flash movie into my web
    page.
    The error message states "The URL cannot contain spaces or
    special characters. Change the path or file name and try again"
    This is the path of the file I am trying to insert:
    cafe_townsend/flash_fma.swf
    any suggestions as to why it isn't accepting this file name?
    What are the special characters they speak of?
    btw I am running osx 10.3.9 on a 933mhz Ibook
    Thanks

    > any suggestions as to why it isn't accepting this file
    name? What are the
    > special characters they speak of?
    It may be a special character in the hd name or other folder
    names on the
    way down to the local site folder.
    What os are you using?
    please do this.
    create a new blank dw document using File-->New
    -->don't save it<--
    please insert an image that is in this site's Local Site
    Folder
    look in code view and copy this image tag. Paste it into your
    reply.
    It should be the full absolute path, like
    <img
    src="file:///hdname/Users/username/folder/folder/image.jpg">
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • What's wrong with the built-in keyboard on my macbook? The caps button does not work rite, no matter what letter button i push they all come out capitals and the number keys when pushed display the special characters instead of the numbers!

    the built-in keyboard on my macbook is not functioning right, the number keys when pushed display the special characters instead of the numbers,
    the caps button doesn't work at all, the letter buttons display capitals when pushed whether the caps button is on or off, the shift keys are also out of whack!!
    It seems it somehow got relocated to the "0" button because if you push and hold the zero button down the keyboard seems to operate normally, the number keys display numbers when pushed the letter keys display lower case when pushed but release the zero button and your back in the twilight zone!! Can anybody help me resolve this issue? one more thing im using an external usb keyboard right now and it seems to function properly if that helps any.

    You would do better in the actual macbook pro forums (this is not).

  • How do you turn off the special characters for letters?

    How do you turn off the special characters for letters? Where you hold down the key and it comes up with variations of the letter. For example ï í î ò œ å ß ł û
    It is very annoying when I try to play any online games. Thanks for the help

    Thank you so much It worked Thank you

  • How to find the 'special characters' window

    Hi,
    Frequently I want to access the 'special characters' window, but when I click on the 'special characters' menu item the window does not appear. Sometimes I later find it on another screen (I use nine screens in Spaces), and sometimes can I see it on another screen using Expose, but when I go there it has disappeared. It seems a very fugitive tool, and in its way displays some cute, personality........ But I would love to know how to find it or to force it to appear on the same screen as the application from which I tried to open it!
    all the best,
    Jeremy Harbinson

    Hi,
    Thanks for the reply.
    I tried what you suggest - in the International section of the System Preferences there is a tab labelled 'input menu' and there is a check box (which is checked) titled 'Show input menu in Menu bar'. Unchecking that removes a national flag from the the menu bar, checking it restores that flag. So far, so good. If a click on the flag, a drop down menu appears with 'Hide character palette' as an item - clicking this changes it state to 'Show character palette' but clicking this (several times) changes nothing else that I can see,
    all the best,
    Jeremy

  • How to  remove the Special characters like @,#,$ ,..from field

    How to  remove the Special characters like @,#,$<,..from text  field. we nedd to remove any specila char from text field .
    ex:text  = just#fi%cation@text
    the text should be justification.

    hi check this ..
    data:char(25) value '5#4#2#&1#&',
         char1(9) .
           replace all occurrences of '#' in char with 'and' .
           replace all occurrences of '&' in char with 'num' .
         write: char.
    or use this..
    data:char(25) value 'test@ing*5#4#2#&1#&',
         char1(9) .
           replace all occurrences of '#' in char with space .
           replace all occurrences of '&' in char with space .
           replace all occurrences of '@' in char with space .
           replace all occurrences of '*' in char with space .
         write: char.
    regards,
    venkat.

  • The special characters are not loading. ?

    For some reason the special characters stopped appearing when I click "Special Characters" under the Edit tab. I don't understand, and unfortunately in my academic work practically a third of the characters I have to use are these. Is there another way to access them or a problem that might be responsible? I already closed and restarted.
    Thanks

    NEVERMIND.
    The window was already open but at the VERY EDGE, barely perceived, at the bottom so I had to grab it real fast before the icons popped up. Lesson learned.

  • Print preview for the special characters / symbols

    While displaying print preview / taking print output using QGA3 Transaction with developed Z SAPScript form specified as one of the parameters(say for example ZARMEXP), the special characters / symbols  like u2018∆u2019 are displayed as u2018#u2019 in the print preview / print output . Of course similar problem had existed for Lambda Symbol u2018u03BBu2019., but it was resolved by using the font type Helve_I7. But for the symbol u2018∆u2019 we checked with almost all the fonts that were available in the system, but of not much use. Hence could you kindly provide us solution(s) that would resolve this issue.

    Hi ,
    Can you please check language are installed properly in sap  check with basis people. then try to print it will work.
    when ever language are not maintin properly , the characters  or symbols are not print properly.
    Regars,
    Munibabu.k

  • How to identify the special characters

    Hi all,
    is there any way to identify all the special characters that are already in the various columns of a table,
    thanks
    db is on 8i
    Edited by: venkata_sudheer on Apr 3, 2009 8:44 AM

    Hello,
    I don't know what's your requriment is and how do you want to handle or treat these special characters but check this function, you can pass special character and it will return back the number or you can extend this function to do the reverse (chr(37) 37=%).
    CREATE OR REPLACE FUNCTION ascii_only (p_txt IN VARCHAR2)
       RETURN VARCHAR2
    IS
       v_number   NUMBER;
       v_char     VARCHAR2 (3 BYTE);
    BEGIN
       v_char := SUBSTR (p_txt, 1, 1);
       v_number := (ASCII (v_char));
       DBMS_OUTPUT.put_line (v_number || ':' || v_char);
       RETURN v_number;
    END;
    /Regards

  • Using devanagari script in the 'special characters' option in Pages

    Using the special characters menu in Pages how can I produce double consonances?  Any help would be gratefully received

    That should be double consonants if you have been searching.
    What keyboard are you using?
    Devanāgarī Typing & Keyboard Layouts (Mac & Windows)
    http://www.indiantypefoundry.com/help/technical-issues/devanagari-keyboard/
    https://discussions.apple.com/thread/3548952?start=0&tstart=0
    Peter

  • Moving through the Special Characters Pane

    I have created a keyboard shortcut on my Mac to quickly display the special characters pane. I was wondering if there was a way to jump to the pane directly from the keyboard without having to click on the pane? Thanks.
    Nibber #1
    Ohio

    Not that I know of.  But you might want to also ask in the OS X forum, since this is not an issue specific to Pages.

  • Remove all the special characters using java.util.regex

    Hi,
    How to remove the all the special characters in a String[] using regex, i have the following:-
    public class RegExpTest {
         private static String removeSplCharactersForNumber(String[] number) {
              String number= null;
              Matcher m = null;
                   Pattern p = Pattern.compile("\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\_\\+\\-\\{\\}\\|\\;\\\\\\'////\\,\\.\\?\\<\\>\\[\\]");
                   for (int i = 0; i < number.length; i++) {
                   m = p.matcher(number);
                   if (m.find()) {
                        number= m.replaceAll("");
                   System.out.println("Final Number is:::"+number);
                   return number;
              public static void main(String args[]){
                   String[] str = {"raghav!@#$%^&*()_+"};
                   RegExpTest regExpTest = new RegExpTest();
                   regExpTest.removeSplCharactersForNumber(str);
    This code is not working and m.find() is "false", here i want the output to be raghav for the entered string array, not only that it should remove all the special characters for a entered string[]. Is there a simple way to do this to remove all the special characters for a given string[]? More importantly the "spaces" (treated as a spl. character), should be removed as well. Please do provide a solution to this.
    Thanks

    You don't need the find(). Just use the replaceAll() on each element of the String[] i.e.
    String[] values = ...
    for (int i = 0; i < values.length; i++)
        values[i] = p.matcher(values).replaceAll("");
    }I can't understand your regex since the forum software has mangled it but you just need to add a space to the set of chars to remove. When you post code, surround it with CODE tags then the forum software won't mangle it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for