JAVA Mapping: Handle Special characters like u00E4,u00FC an so on

Hi everybody,
we have a JAVA Mapping that gerenates text nodes with special characters.
The generated XML is later used in an graphical message-mapping.
During runtime we ge the trace/error:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error:
com.sap.engine.lib.xml.parser.ParserException: Unsupported character: 31(:main:, row:1, col:2498) at
com.sap.aii.mappingtool.tf3.Transformer.checkParserException
Does anybody know, how to modify the JAVA-mapping to have a workaound for this problem?
Thanks
Regards Mario
Edited by: Mario Müller on Jul 22, 2008 4:33 AM

Hi Mario,
As java mapping does not validate the xml,the output gets created but if u have to use the xml structure,the u will have to include the following.
Assume u r using a write method to write the output xml,then
check for tspecial charactters like &,<,>.' etc and replce them as shown below
private void write(String s)
     //Traverse through the string
for (int i=0 ; i < string.length();i++)
     String s1 = data.substring(i, i + 1);
          if (s1.equals("&"))
               write ("&amp;");
          else if (s1.equals("<"))
          write("&lt;");
          else if (s1.equals(">"))
          write("&gt;");
          else if (s1.equals("\""))
          write("&quot;");
          else if (s1.equals("'"))
          write("&apos;");
          else
          write(s1);
Should help u out
Edited by: Mohd Tauseef Ibrahim on Jul 22, 2008 11:08 AM
Edited by: Mohd Tauseef Ibrahim on Jul 22, 2008 11:09 AM

Similar Messages

  • To Handle Special Characters(Guideu0099 ) in MATMAS IDOC fields

    Need to handle special characters like Guide™, as an attached  superscript in MATMAS02/05 IDOC field . The field name is TDLINE in E1MTXLM segment.
    As a trial run when these special characters are pasted in the TDLINE field, it throws an error that "the input field contains prohibited characters"
    Please let me know if there is any workaround for this.

    hi
    good
    go through these links, i hope these ll help you to solve your problem.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAGTFADMLO/CAGTFADMLO.pdf
    http://www.erphome.net/wdb/upload/forum14_f_2908.doc
    thanks
    mrutyun^

  • Problems with special characters like "u00F6" "u00E4" "u00FC"

    Hi,
    we currently face some major problems with special characters like "ö" "ä" "ü". First I thought it is a SP02 specific problem but it still doesn't work with SP03.
    When I start an import the import manager shows correct converted value. "ö"s "ä"s "ü"s are displayed correctly. But after I've done the import I look into the Data manager and I see instead of these characters charcaters like "&#776;". (note: the character should show a little square box - but the forum cannot desplay it)
    How can I solve this problem?
    Regards
    Nico

    Hi Nico
      Just try it out the following steps, hope it solves ur issue.
    <b>To set one or more values back to their original values:</b>
    1. In the Import Manager Source Values grid, select the values that you want to set back to their original values.
    2. Right-click on one of the values and choose Set to Original Value from the context menu, or choose Values > Apply Value Conversion Filter > Set to Original Value from the main menu.
    3. MDME sets each value back to its original value, which appears in black in the Source Values grid.
    <b>NOTE : You can use the Set to Original Value filter only at the value-level and not at the field level.</b>
    thanks
    Alexander

  • How to Handle Special Characters in PI7.1

    Hi Team,
    I need to handle some special characters like <,>,& etc.. from WS Adapter to CRM in PI 7.1.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    By using the above blog i had implemented the Java Code as
    public void execute(InputStream in, OutputStream out){
    try{
    int read_data;
    while((read_data = in.read()) != -1){
    if (read_data == '&'){
    out.write("&amp;".getBytes());
    }else if (read_data == '>'){
    out.write("&gt;".getBytes());
    }else if (read_data == '<'){
    out.write("&lt;".getBytes());
    }else if (read_data == '/'){
    out.write("&frasl;".getBytes());
    }else if (read_data == '\''){
    out.write("&apos;".getBytes());
    else { out.write(read_data);
    out.flush();
    } catch (Exception e){}
    I had added this class file in Operational Mapping.
    It is working  if we have only one IF condition for & in while
    Any suggestion
    Thanks
    Sriram

    Hi Ramesh,
    Thanks for your inputs, I have tried your code but it is not working. The error message stays the same.
    Dear Stephane,
    To describe the error more, the requirement is the payload coming from source through WS Adapter consists of the special characters <, > , & which are basic sematics of XML syntax. I need PI to process this payload with special characters and successfully transfer it to target CRM system. I have created the Java class with code (ref: Blog 9420) as stated earlier and added this class to my existing Operation Mapping. I am expecting the java mapping to replace the special characters in payload like  < with "&gt;" . So as the case with the other characters >,&,'
    After activaton of my operation mapping, I triggered the test message with Soap UI client and I could able to get a successful mapping only When I put the logic for &ampersand symbol only. However when I am trying to add the logic for > or < or ' the mapping is failing . I am using UTF-8 encoding across the source and PI enviroments.
    Sample SOAP message :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:abcabca.com">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:MT_ABCDEFG_Req>
         <activity>
              <id/>
              <type>ZEMA</type>
              <actionType>C</actionType>
              <firewall>10000003</firewall>
              <subject>small &gt; &lt; attachment test</subject>
              <location/>
              <startDate>2010-07-08T10:53:31.000Z</startDate>
              <endDate>2010-07-08T10:53:31.000Z</endDate>
              <mainClient>1000319</mainClient>
              <mainContact>1000003</mainContact>
              <isConfidential>false</isConfidential>
              <summary/>
              <fullText>test body  - small.txt</fullText>
              <owner>1000021</owner>
              <from>ABCDEDF</from>
              <sendTo>emailaddress</sendTo>
              <copyTo/>
              <keywords/>
              <referenceId/>
              <createdBy>1000021</createdBy>
              <additionalContacts/>
              <additionalClients/>
              <additionalParticipants/>
              <status>A0008</status>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>small.txt</fileName>
              </attachments>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>EMail 2010-07-08.pdf</fileName>
              </attachments>
         </activity>
          </urn:MT_ABCDEFG_Req>
       </soapenv:Body>
    </soapenv:Envelope>
    Output on the SOAP UI  client for the above request:
    <!--see the documentation-->
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context>XIAdapter</context>
                   <code>ADAPTER.JAVA_EXCEPTION</code>
                   <text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIServer:NO_MAPPINGPROGRAM_FOUND:
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1160)
         at sun.reflect.GeneratedMethodAccessor342.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(
    What do you think where I am doing the wrong?
    Sriram

  • Error while handling special characters ( and &) in Sender File adapter

    Dear All,
    Scenario: Third Party System --> (File adapter) SAP PI 7.1 (SP05) --> (Proxy) ECC
    We are receiving CSV file and no mapping is required in PI as all the processing is being done by third party tool. But we are receiving special characters like ',",>,< and & in the csv file.
    When we are using File Type as TEXT and File Encoding as ISO-8859-1 than we are getting error. We changed File Type to BINARY and than we are able to handle ',",> but having issue in handling < and &.
    Any idea how we can handle it.
    Please note trhere is no Mapping in SAP PI so cannot uise Java mapping.
    Thanks a lot
    Chanakya

    Hey,
    You can add ABAP Script in Receiver Proxy for eliminating or replacing with NULL or empty. Since you dont have mapping for formatting these kind of junks you can follow the above approach.
    Else, you can remove the junks at OS level while running a small script and make it available to PI.
    Or else, you need to create mapping for sender and recevier structure though it is same, then you add a very simple UDF for fine tune.
    Use this UDF
    Here a is the input value.
    String b = "";
    b = a.replaceAll(",", "0");
    b = a.replaceAll("@", "0");
    Like all the special characters you can take and replace with zero.
    return b;
    Thanx
    Pothana

  • Handling special characters through proxy

    Hi Gurus,
    we hvae a scenario sap to file, sending material information from SAP through outbound prpxy and palcing that detaisl in FTP loation using file adapter.
    Here probelm is one of the fields desc and text we are passing material Description and basic text which may have special characters like # @  µ while these cahractrs coming to XI itselfthey are convering as #0 and giving soem fatal error in XI whaich is unabel to parse in XI mapping and end up with mapping error.
    One more thing the if i use test the interface in dev and qa with the same characters these are working fine only failing in prod.
    please suggest how to procedd furthur.. whhetehr there is any place to check this special charatcres ecoding, uncode maintned at r/3 side or side side.
    here is the error
    Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #0 not allowed in Character data sections(:main:, row:1, col:1607794) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:157) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:73) at java.lang.Thread.run(Thread.java:770) Root Cause: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser : #0 not allowed in Character data sections(:main:, row:1, col:1607794)(:main:, row=1, col=1607794) ->
    Edited by: Jitender Devunuri on Oct 26, 2009 3:33 PM

    Hi all .... any idea

  • Handling special characters in XML

    Hi,
    I am using Oracle 10g 'XMLType' datatype to store XML files. Before storing I parse the XML document using Java Xerces Parser. If it parses successfuly, then I perform some business rule execution based on XML file which was parsed. So till this stage there is no problems. But when XML file contains some special characters like copy-paste of some description from MS-Word document into XML tags, then Xerces parser will parse such characters with out any exceptions, but while inserting XML document, Oracle database just throws exception saying unable to handle special characters.. So how to avoid such exceptions or silent such exceptions with any specific settings respect to XMLType datatype in 10g DB.
    Please advice!
    Arvind Patil - IN

    Monica--
    In XI 2.0, we've noticed a number of issues processing special characters, primarily caused by the version of JCO that we're running.  It sounds like SAP has spent some time in the past few months focusing on these errors, so make sure you're on the most recent patchlevels of all your middleware components, including any of the middleware libraries that BC uses. In XI, we had to update the 3 files that make up the RFC library and JCO library.  SDM couldn't update the libraries for us -- we had to manually move the files to the right place.
    Escaped XML characters like "&amp;" "&#34;" "&quot;" were fixed as of JCO 2.0.10 (the current patchlevel on AIX/UNIX), the special character "&apos;" is fixed in the next release, JCO 2.0.11, due out in a few weeks (hotfixes are available).  I don't know the equivalent versions on other platforms.  By default, XI 2.0 appears to have shipped with JCO 2.0.5.  I would expect many XI 3.0 users to also be affected.
    This may or may not apply to BC, because I don't know what BC uses to talk to SAP under the covers.
    --Dan King
    Capgemini

  • Time-dependent Vendor Master & Handling Special Characters

    Hi,
    I need to extract time-dependent Vendor Master.
    1. The data source for <b>0VENDOR</b> does not have fields to hold the valid date range.
    2. Does the Master data in R/3 for Vendors will hold the valid date range?
    3. The text for <b>0VENDOR</b> provides time-dependent, but how to map the <b>valid from</b> and <b>valid to</b> fields?
    Handling Special Characters:
    We are trying to extract data from Legacy system via DB Connect. The item text field consists of special characters. Of course in BW customization we can specify all the special characters to consider. But the special character we observed is 'square' symbol i.e. 'new line character' in Oracle. We are updating this to an ODS object. When looked at error log, observed that green light for the number of records transferred and updated, but finally when it load into ODS object and activates popping up the error message saying 'could not recognize special character'.
    Please help me getting the 2 issues resolved.
    Thanks in advance.
    Regards,
    Sudhakar.

    Hi Everyone,
    Thanks for inputs on Special characters issue...
    Finally resolved with below piece of code in the start routine:
    DATA: FLAG,
          OFF TYPE I,
          LEN TYPE I VALUE 1,
          ALLOWED_CHAR(95) VALUE
    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()-_=+ ' &
    'abcdefghijklmnopqrstuvwxyz:;<>,.?/|\{}[]"'''.
    CONSTANTS: C_CHAR VALUE '-'.
      LOOP AT DATA_PACKAGE WHERE NOT /BIC/ZI_DESC IS INITIAL .
        DO.
          IF DATA_PACKAGE-/BIC/ZI_DESC CN  ALLOWED_CHAR.
            REPLACE SECTION OFFSET SY-FDPOS LENGTH LEN OF
                    DATA_PACKAGE-/BIC/ZI_DESC WITH C_CHAR.
            FLAG = SPACE.
          ELSE.
            FLAG = 'X'.
          ENDIF.
          IF FLAG = 'X'.
            EXIT.
          ENDIF.
        ENDDO.
        MODIFY DATA_PACKAGE.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    I have seen the link sent by 'Eugene Khusainov' today. Thought putting my piece of code that may help others...
    Regards,
    Sudhakar.

  • How to handle special characters in Apex

    Hi ,
    In my application I have two regions - one is Report Region (Interactive Report) and other one is HTML region with two text items - Empno and name
    My Report has two columns Empno(varchar2) and Ename(varchar2).
    When I click the edit link in the report column, the empno should have a read only EMPNO value and ename is a text field with ENAME value.
    When I run my application I have encountered the following problems :
    1. if my empno has special characters like ' # ', the characters after that is not getting displayed
    2. if my empno has special characters like ',' - the characters after comma is treated as a next texitem value
    Here is my credential ,
    Workspace CTSAN_ORACLE_DB
    Username [email protected]
    Password lakshmi321
    URL : http://apex.oracle.com/pls/apex/f?p=9444:19:4292839314890159:::::
    Plz. suggest me how to rectify the above problems.
    Thanks,
    Anoo..
    Edited by: Anoo on Aug 13, 2010 3:05 AM

    Don't pass data values in URLs. Whilst it is possible to escape values to make them URL- and APEX parameter-safe, it is much better practice to avoid the problem altogether.
    Create a surrogate primary key on the table that is an immutable discrete numeric identifier and only use this as a URL parameter. In target pages/regions, use this PK value to retrieve the required data from the table.

  • 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.

  • Handle special characters in SQLPLUSW window.

    Dear SQL Gurus,
    In my organisation every day we receive some data changes from developers and we need to do those changes in all databases. I developed a shell script to automate this procedure. but the problem I am facing problem with special characters like TM(trade mark), (R) - reserved character.
    To store these values in the database our team members are using TOAD for insert operations. If I execute the same statemenst from SQL prompt I am not able to store the special characters in database.
    we are using 10.2.0.4 version on sun solaris10. Please help me in this.
    Thanks,
    KPS

    Dear Saubhik,
    please let me know the procedure to insert the special character from SQL prompt. You explained about how to retrive from database using select statement. It is really good. our developers give the insert statements in word documents. so that they can place the special characters.
    Thanks,
    KPS

  • Handle special characters in the attribute name

    Hi,
    I am generating different view element in WD application dynamically. How to handle special characters other than '-/ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789'  for the attribute name dynamically?
    Thank you, in advance.
    Trupti

    Going with the obvious response - don't use them?
    if you're using dynamic code, there is no reason (other than debug support) to give your created elements any meaningful name.
    Just generate a GUID for each new element and use that.
    If you need to be able to later search for and update the element a simple lookup table of GUID to reference string should work reasonably well.
    Cheers,
    Chris

  • Always jumps back to special characters like ü,ö,ß

    hello,
    so i have been having problems with my macbook pro recently. it has a US keyboard but i write a lot in german so i have to use special characters like ä,ü,ö,ß which normally is not a problem, because i can just stay longer on the a,u,o,s keys and it works perfectly. however, recently when i was typing one of the special characters a lot of the time it jumped back to the previous one i had typed a couple of words back.
    this is really really annoying and i do not know what i can do about it or what i am doing wrong.
    it would be awesome if somebody knows a way how to fix this problem.
    thank you for your help!

    Hi,
    Unicode or Non-Unincode System ?
    Displayed where ? SAPGUI ? Print Preview ? Spool-Display ?
    And how is the XML file written ?  OPEN DATASET ? BAPI ?
    At all of these stages it might be either that it is only a display system, like the selected display CHARSET in SAPGUI, when it is a non-unicode system, or simply not coded correctly like OPEN DATASET without specifying the cdepage when necessary.
    And it might even be, that even "displaying" the XML File is simply done with the incorrect codepage while the data inside the file is correct.
    If you are on Windows, you might even face funny results when saving a simple textfile from notepad with ANSI/DOS and both Unicode variants and then go to CMD.EXE ans simply "type" the content.
    All 4 results will be different, allthough notepad will display the same stuff.
    So first of all, makes sure which codepage is relevant at all stages from DB-table to "display"
    - DB-Charset
    - SAP system type (unicode/non-unicode)
    - SAP codepage (1100 / 410x )
    - crosscheck the test from report RSCPINST
    - Codepage on Windows running SAPGUI
    - Selected codpage for Sapgui
    Good hunting
    Volker

  • Special characters like §

    i have some issues with special characters like § appearing correctly in the PDF. They appear as º in the PDF
    EX : I am using in datfile like
    ^filed txt_a1
    § 333.23
    Output PDF like :
    º333.23
    Any ideas anyone?

    Hi ramusw,
    I think you might need to get the font that allows these special characters and include them in the Presentment target setup.
    James.

  • Printing Special Characters like u00F1 , u00F3 etc

    Hello ABAP gurus,
    I am facing issues while printing special characters like ó or ñ  using SAP script during check printing from F110 Tcode. 
    The system was recently upgraded from 4.7 to ECC 6.0 and this was when the user reported this error.
    Please Help !.
    Cheers,
    RK

    Hi Adrian,
    I have posted to the user asking him the output device name.
    Hi Nils,
    When the user prints the check, he sees junk value instead of the character ñ.
    I am not sure as to which output type they are using and will update as and when i get an answer form them.
    Thanks,
      RK

Maybe you are looking for

  • Remote app with iOS 5.1 possible?

    In The app store only iOS 7 for down load!!

  • [SOLVED] Suspend button no longer works after update

    Recently update my system, and now pressing the suspend button (Fn+F3 in my case) doesn't suspend it to ram as it did before. Running acpi_listen and hitting the button gives me the output "button/sleep SBTN 00000080 00000000 K" so clearly it's heari

  • AIR 3.9.0.880 StageWebView and Retina MBP

    When I compile my app using AIR 3.9.0.880, my StageWebView is 1/4 size on my Retina MBP unless I pass true to the StageWebView constructor for the "useNative" parameter. Is this by design? I have this set in my app descriptor: <requestedDisplayResolu

  • Not able to connect to wireless network using WEP 128 bit hex password

    I'm using a 128 bit hex WEP password on a Belkin wireless router. My ascii passphrase is 13 characters. I tried using the hex password generated by the Belkin router, as well as the hex equivalent of my ascii passphrase. Every time, I am told that ei

  • Open PDF in Acrobat from flash movie

    Hi all, I have made a flash autorun splash screen for a CD containing numerous pdf' files. When I click on the files in the flash movie however, they open in a browser window. Is there any way to make them open in acrobat by default?