Special characters in CLOB are making report fail

Hi-
I am working on a report which is refering CLOB column from database. If the CLOB had special characters like & or <, the report is returning error 'Expected name instead of .' I created a view and stored CLOB as varchar2 and refered the view in query and the report works fine, but the drawback of this is varchar2 max limit is 4000 chars and the text i intend to show is more than 4000 chars.
Can someone share any ideas on how to get around this error?
Thanks in advance.

Hmm, thought I'd dig a little to see what you guys mean. Indeed XML Publisher Data Template doesn't translate CLOB special characters and so BIP chokes!
My advice - log a bug and write XML output in PL/SQL.
Here's my working for reference (note spaces added after & to preserve special chars!):
CREATE TABLE test_clob (
id            NUMBER(15)
, file_name     VARCHAR2(1000)
, file_contents CLOB
, timestamp     DATE
insert into test_clob
(id,file_name, file_contents)
values
(3,'Greeting = <Hello, world>','Greeting = <Hello, my funky file contents>');
ed gg.sql
select '<?xml version="1.0" encoding="UTF-8" ?>'
from dual;
select xmlelement("row",
                  xmlelement("file_name", file_name),
                  xmlelement("file_contents", file_contents))
from   test_clob
where  id = 3;
:q
set serverout off termout off echo off verify off head off trimspool on
set lines 300 pages 0 long 20000
spool gg.xml
@gg
spool off
exit
cat gg.xml
<?xml version="1.0" encoding="UTF-8" ?>
<row><file_name>Greeting = & lt;Hello, world& gt;</file_name><file_contents>Greeting = & lt;Hello, my funky file contents& gt;</file_contents></row>
OKAY: both fields translated! Let's try using dataTemplate
<?xml version = '1.0' encoding = 'utf-8'?>
<dataTemplate name="XXV8_CLOB" description="$Header$" defaultPackage="" Version="1.0">
<parameters>
</parameters>
<properties>
<property name="include_parameters" value="true" />
<property name="include_null_Element" value="true" />
<property name="include_rowsettag" value="false" />
<property name="scalable_mode" value="on" />
<property name="debug_mode" value="off" />
</properties>
<dataQuery>
<sqlStatement name="Q_LOBS">
<![CDATA[
select file_name, file_contents
from   test_clob
where  id = 3
]]>
</sqlStatement>
</dataQuery>
</dataTemplate>
OUTPUT:
<?xml version="1.0" encoding="UTF-8"?>
<XXV8_CLOB>
<LIST_Q_LOBS>
<Q_LOBS>
<FILE_NAME>Greeting = & lt;Hello, world& gt;</FILE_NAME>
<FILE_CONTENTS>
Greeting = <Hello, my funky file contents></FILE_CONTENTS>
</Q_LOBS>
</LIST_Q_LOBS>
</XXV8_CLOB>
CHOKE:
Post-processing of request 2805016 failed at 18-MAR-2008 22:59:19 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
Error message in OPP output processor:
Template code: XXV8_CLOB
Template app:  XXV8
Language:      en
Territory:     US
Output type:   PDF
[3/18/08 10:59:18 PM] [UNEXPECTED] [752315:RT2805016] java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at oracle.apps.xdo.common.xml.XSLT10gR1.invokeParse(XSLT10gR1.java:517)
     at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:224)
     at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
     at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1657)
     at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:967)
     at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5888)
     at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3438)
     at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
     at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:247)
     at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
Caused by: oracle.xdo.parser.v2.XMLParseException: Expected name instead of ,.
     at oracle.xdo.parser.v2.XMLError.flushErrors1(XMLError.java:324)
     at oracle.xdo.parser.v2.XMLReader.scanNameChars(XMLReader.java:1056)
     at oracle.xdo.parser.v2.XMLReader.scanQName(XMLReader.java:1768)
     at oracle.xdo.parser.v2.NonValidatingParser.parseAttr(NonValidatingParser.java:1444)
     at oracle.xdo.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1394)
     at oracle.xdo.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1225)
     at oracle.xdo.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314)
     at oracle.xdo.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281)
     at oracle.xdo.parser.v2.XMLParser.parse(XMLParser.java:266)
     ... 17 moreAs you can see the varchar special characters are "escaped" or translated or whatever you want, but not the CLOB!
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/

Similar Messages

  • Special Characters in charts with web reports

    Hello, we are facing a problem to display special characters in charts on web reports (it comes out badly).
    The only sap note found about this problem is note n°1036745, but it is for NW 2004s, but should be solved in NW04s BIJava SP 12, and we are currently with SP 15.
    Has anyone faced this problem with BI 7.0?
    Thanks,
    Philippe

    hi Philippe
    I did not faced this issue. Nevertheless there is another note dealing with the issue. Note 1088411.
    Take into account that your basis should synchronise the level of BI JAVA SP the famous Java Stacks and BI SP (ABAP support package).
    You say that you are SP 15 I guess it is ABAP SP as SPS for 15 is not already shipped,
    if this is not the case please ask your basis to check tihs note 1013369.
    Hope this could help you
    regards
    Boujema

  • Special characters not shown in OBIEE report

    Hi
    We are facing an issue with column values containing special characters in the reports(OBIEE 11G, 11.1.1.6.5). In-spite of actual column values i.e. special characters, NULL is displayed/shown. It would be very helpful if any work-around/pointer is provided for the resolution of this issue.
    Thanks

    Hi,
    Go with Dhar suggestion, While installing the database itself we have the options "unicode type" for special characters.
    Now Create one more instance and install the database use the unicode option to resolve.
    i faced for arabic character i found this mode.
    for more reference http://mkashu.blogspot.com
    regards
    VG

  • Formula to show non english characters from clob in crystal report

    Hi
    I am using the database Oracle 11g with a field clob in one of the table that i want to show in the crystal report
    But the problem is when i put the clob field in crystal report it is outputting the results perfectly for English characters but not for the Arabic ones and returning the string like (¿¿¿¿ ¿¿¿¿ ¿¿¿ ¿¿¿¿ ¿¿¿¿ ¿¿¿ ¿ ¿¿¿¿¿ ¿¿¿)
    so is there any way to show the arabic (non english) characters perfectly on crystal report with clob field

    Hi Azeem,
    Make sure the arabic font should install in your system.
    Try this:
    Create a text field in your Crystal Report (a label).
    Place Arabic characters into that field (just by typing them into it on the report definition).
    Run the report. If they display correctly then its probably not Crystal, but rather would point to an issue in the data retrieval and supply to Crystal via your dataset (or whatever datasource you are using).
    If they don't display - then its definitely Crystal.

  • Displaying special characters in ALV report.

    Hi Experts,
    Can we display special characters in ALV reports? Special characters such as tick mark.(Like in character map(Font Bookshelf  Symbol 7) of windows ).
    I tried with icons in ALV report, I was able to display tick icon in the ALV report, but when we export the report in to a excel, the icons comes in as Hexadecimal code.
    Can any we display special characters like tick in ALV report or display the icons in excel aswell?
    I will be gratefull for the <urgency reduced by moderator> response.
    Regards,
    Sharath.
    Edited by: Thomas Zloch on May 10, 2011 10:26 AM

    Sharath,
    I think it is possible to do so.
    Please check this link.
    http://www.sapfans.com/forums/viewtopic.php?f=13&t=322569
    Thanks,
    Guru.

  • How to escape special characters in Simple Transformation

    Hi Experts,
    I have got a problem to get a well formed xml document from the below simple transformation. The content of maktx contains
    special characters like & <, which are not allowed in a well formed XML-Document. But the result of the Simple Transformation
    contains this charcters even after the transformation as you can the in the result below. Has anyone a hint how to escape the
    characters included in the maktx.
    The transformation for maktx, should be something like
    Before: Material & < TEST
    After: Material &amp &lt TEST
    Report wihich calls the simple transformation
    types:
    BEGIN OF t_mat,
       matnr type matnr,
       maktx type maktx,
    end of t_mat.
    Data:
      mat type t_mat,
      xml_stream type xstring.
    START-OF-SELECTION.
    mat-matnr = '4711'.
    mat-maktx = 'Material & < Test'.
    CALL TRANSFORMATION ztest_st2
            SOURCE mat = mat
            RESULT XML xml_stream.
    CALL FUNCTION 'DISPLAY_XML_STRING'
      EXPORTING xml_string = xml_stream.
    Simple Transformation
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="MAT"/>
      <tt:template>
        <Leistungsschild>
            <CHARACT> MATNR </CHARACT>
            <CHARACT_DESCR> Materialnummer </CHARACT_DESCR>
            <VALUE tt:value-ref="MAT.MATNR"/>
            <CHARACT> MAKTX </CHARACT>
            <CHARACT_DESCR> Materialkurztext </CHARACT_DESCR>
            <VALUE tt:value-ref="MAT.MAKTX" />
        </Leistungsschild>
      </tt:template>
    </tt:transform>
    RESULT
    <?xml version="1.0" encoding="utf-8" ?>
    <Leistungsschild>
      <CHARACT>MATNR</CHARACT>
      <CHARACT_DESCR>Materialnummer</CHARACT_DESCR>
      <VALUE>4711</VALUE>
      <CHARACT>MAKTX</CHARACT>
      <CHARACT_DESCR>Materialkurztext</CHARACT_DESCR>
      <VALUE>Material & < Test</VALUE>   </Leistungsschild>

    Hi Sandra,
    First of all thaks for your quick answer to my problem.
    I see what you mean and get the same result, if I am using data-type string instead of xstring. But the recommendation in the XML-Books of SAP is to use XSTRING to save memory and circumflex problems between Codepages, when writing the XML-Stream to a filesystem.
    As you can see in the code abvoe I am using a SAP-FM to display the XML-Stream and this FM works only with XSTRING´s,
    that is one reason why I don´t understand that it displays it in the wrong way.
    Even the Debugger shows me for the XSTRING the wrong result. Does all that mean that the escaping will not be applyed if you are working with XSTING´s??

  • Special Characters problem in PI 7.1

    Hi,
    We have simple integration from R3 to JMS. from R3, idocs contain special characters, and they are getting converted in to different chanracters in integration engine. So making the output data currupted.
    I tested the same message in mapping test tool and the target message contains actual special charcters. Below is the example,
    Input: 
    i was thinking of using XMLAnonymizer, but the problem is in integration engine itself. I can see invalid output in SXMB_MONI.
    so could some one help me how can i fix this issue?
    Many thanks in advance.
    Regards,
    Prasad..

    Hello,
    Please check this document to sort out your issue:
    How to Work with Character Encodings in Process Integration (NW7.0):
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Br,
    Dzmitry

  • Dynamic insert for Special Characters

    Hello,
    I'm running into a problem inserting data with Special Characters. I have a report (designed oracle reports), that takes data and inserts the data into table. I use the SRW.do_sql built in package in a before report trigger to process the data. However the problem that I'm running into is how to dynamically account for the special characters in a description field that I have. There is no way for me to predict where or how many can appear in a field. For example, I may have a field that contains data like:
    O'REILLY AND ASSOCIATES INC.
    OR
    FULLER & D'ALBERT, INC.
    OR
    JOANNE'S BED & BACK SHOP
    The only special characters that seem to be used and are causing me problems are the " ' " and " & ".
    Does anyone know how I can dynamically account for these special characters in my insert statement?
    Thanks,
    Martin

    Hello,
    I'm using SRW.DO_SQL procedure in oracle reports because that is one you can run text via reports. The report actually exports the results to a text file and insert the results into a table. Anyway, the SRW.DO_SQL isn't my problem but rather the special characters. I have researched the problem some more and I have found a solution. You can use the "replace" feature to do an insert/update of special characters. You also need to find the character number for each special character. I believe "&" is chr(38), "%" is chr(37), "#" is chr(35), "@" is chr(64), "'" is char(39). So the code would be:
    insert into tableA (column1) values(
    replace(replace(replace(replace(replace(v_entity_name,chr(39),chr(39)),chr(38),chr(38)),chr(35),chr(35)),chr(37),chr(37)),chr(64),chr(64));
    Martin

  • Special characters added in offline approval email

    Hi all,
    We are on SRM 5.0 SP13 ,ECS
    We are facing an issue with the outbound emails sent out from SRM system for offline approval for both shopping carts and PO.
    In the main body of the  email,some some special characters like ^A are being added at the start of each line.
    We have been observing this issue lately after the upgrade of our mail server.
    Has anbody come across such an issue in SRM 5.0??Please advise /share your solution/provid some insights.
    Thanks!

    Take a look at the note and see if it applies to your case.
    1019942     wrong encoding for HTML formatted emails

  • German Special Characters not displayed correctly in RTF  using code

    Hi ,
    In my code we are using webdynpro method
    WDResourceFactory.createResource(
    byte[] data, String resourceName,WDWebResourceType
    Type)
    Here in our code we are implementing this as
    ITemplateElement templateEl = wdContext.currentTemplateElement();
    WDResourceFactory.createResource(
    templateEl.getReportData(),
    reportName.substring(0, reportName.lastIndexOf('.')),
    WDWebResourceType.RTF); reportName.lastIndexOf('.')),
    Here templateEl.getReportData() returns a set of bytes which has some
    german special characters.
    We are generating the Bytes using String.getByes(),Just before
    String text = new String(in);
    collector.putBusinessObject(boName, bo);
    reportDocTemplateParser(collector, text);
    collector.removeBusinessObject(boName);
    String generatedText = collector.generateRTF();
    out = (null != generatedText) ? generatedText.getBytes() : null;
    The out put is the if i am giving a word with german special characters for eg:
    Betriebsübersichten it first gets converted to bytes and then passes through method WDResouseFactory.createResourse(.....) which creates an RTF file and finally in the RTF file it appears as Betriebsbbersichten the special character is not displayed correctly.
    i came to knw that while converting into bytes we have to make it RTF supported encoding.ie for eg generatedText.getBytes('cp1252').i even tried with other charactersets like ISO-8859,cp1253 and so on but none of them worked.
    It would be really great if you could suggest the needful.
    Thanks and Regards
    Neeta

    I soved this by using get_data function of response object. Then converting this into ISO-8859-1 charset.
    See code below.
    DATA :  lv_encoding   TYPE abap_encoding,
              lv_conv       TYPE REF TO cl_abap_conv_in_ce,
              lv_x_string   type xstring.
      lv_x_string = pv_http_client->response->get_data( ).
        lv_encoding = '1100'.
        lv_conv = cl_abap_conv_in_ce=>create(
                              encoding = lv_encoding
                                 input = lv_x_string ).
        lv_conv->read( IMPORTING data = pv_result ).

  • Problem with special characters getting converted into '#'  in portal

    Hi All,
    The special characters like " - ", " ' ", " ` ",  are getting converted into '#' when the smartform is displayed in portal.
    I have a smart form in which the text contains the above special characters and they are getting displayed as  ' # ', when the form is invoked in portal. We are not able to trace the problem.
    I need your input on this ASAP.
    Thanks in Advance,
    Sowmya

    This could be caused by conversion routine on the field.
    in sapscript, can use &FIELD-NAME(K)& to ignore conversion routine
    To see this and other options, in text edit of script select menu option Insert>Symbols>New  and then type field name and select desired check box options - field will be placed in script with relevant formatting characters
    Andrew

  • Smart Web Printing does not show/print german special characters (äöü)

    I have installes Smart Web Printing on my computer with WIndows 7. I do use a german localization. Selected text is shown and printed correct, except german special characters ä ö ü. They are even not shown correctly in the menues of the application.

    Response to cor-el suggestions:
    I tried what you suggested as far as checking the theme (it's "Default 8.0") and deleting the sessionstore files (there was one .js file, one -1.js file and one .bak file). I still have the same slow response problems (especially typing, it has gone dead on me for a short time twice while typing this replay so far, now a third time) and lost of headers and trailers and some data.
    I did the suggested actions three times just to make sure that I was doing them correctly. On the first try, the sessionstore.js and sessionstore-1.js was more than twice the size of sessionstore.bak. Since doing what was suggested, the sessionstore.js and sessionstore.bak are, I believe, the same size. I did not write down their size is why I am not certain.
    The printing problem appears to only be with one website which is an investment website which I would prefer not to document here. I print from this website each weekday and I have confirmed that the printing problem started when the upgrade to version 8.0 occurred.
    I need a solution to this or I am going to either go back to IE (Ugh!) or find another browser. The typing delays are an extreme annoyance since I do lots on the Internet including a lot of emailing. The delays also involve the buttons to select functions within a website.
    Is there a way to get back to the version previous to version 8.0?

  • Transaction to manage special charactere in BW

    Hi,
    Is anybody could send me the transaction to manage special charactere ?
    Best Regards
    Gregory

    Hi,
    you are right with: the special characters in there are allowed in BW characteristics.
    But: not all characters you enter are also allowed to enter in there. I just had the issue, that I was not able to enter the euro sign &#8364; in there.
    regards
    Siggi

  • Special characters in title of KM resources

    Hi,
    I am trying to set title of resources programmatically. I have some documents in french, spanish uploaded in KM.  I am reading  title from an excel file as a string and then setting it as title property of  a resource. When their title contains special characters, it displays "?" or squares .
    Is there any solution for this problem?

    Hi Julian,
    When I set title containing special characters manually, they are displayed correctly in KM folder. But when I use following code for setting title, squares or "?" is displayed. In the code below, title is a string variable.
    propName = new PropertyName(CREATED_BY_PROP_PREFIX1,"displayname");
    p = new Property(propName, title);
    res.setProperty(p);

  • Sapscript -  error in special characters

    I have a workflow task with the description which ends up getting sent out via email.
    I am entering the following in the description line.
    <a href=http://www.msn.com> MSN </a>
    What is occurring in the output is that the “<” is being translated to “&#060:”
    According to what I can find the “<” and the “&” are special characters. We are able to get around the “&” by doing the following “<(>&<)>”, but I cannot seem to figure out what the trick is for the “<”.

    Hi !
    You could trie to mark this line as a "raw line" / marked as ( . Then SapScript does no formating in this line.
    Here's some of the SAP-Help infomtation:
    (   Raw line                                                          
        The subsequent editor line is not interpreted by the SAPscript    
        composer during output formatting. This means that character      
        formats, symbols, tab characters, masking characters, or          
        hypertext links which may be contained in this line are not       
        evaluated and are therefore passed unchanged to the output        
        device. The text contained in this line is also appended          
        directly to the character of the preceding text line which was    
        output last. If this is not required, there must be at least one  
        blank at the beginning of the extended line.                      
    /(  Like raw line                                                     
        But the subsequent text is placed in a new line during output     
        formatting.               
    Regards
    Rainer
    Some points would be nice if that helped a bit.

Maybe you are looking for