on 02-15-2008 11:16 PM
Hi ALL,
In one of my interfaces i am receiveing small boxes in the text field from SAP. It's coming in the string field, however the mapping fails due to XML parser error. After I remove it, mapping passes successfully. Process team needs that boxes to be passed on to the receiver end.
Someone suggested we could you CDATA to pass such characters. Could sometell me how to use and where to use CDATA?
Regards,
XIer
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer Henrique Pinto's answer in below link, may be this kind of manupulation will help you
Thanks
Swarup
Hey!
Some say you can use CDATA in graphical mapping, but for me the solution was to develop a stylesheet to put my values in CDATA elements.
Let's say your XML element <ServiceProviderName> needs to be in CDATA element, do like this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<Message>
<ServiceProviderName>
<xsl:if test="Message/Response/FromInfo/ServiceProvider/ServiceProviderName != ''">
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]>
<xsl:value-of select="Message/Response/FromInfo/ServiceProvider/ServiceProviderName"/>
<xsl:text disable-output-escaping="yes"><![CDATA[]]]]>
<xsl:text disable-output-escaping="yes"><![CDATA[>]]>
</xsl:if>
</ServiceProviderName>
</Message>
</xsl:template>
</xsl:stylesheet>
If field has the value <ServiceProviderName>this is a test</ServiceProviderName> the result will be:
<ServiceProviderName><![CDATA[ this is a test ]]></ServiceProviderName>
Develop the stylesheet in f.ex XMLSpy (or only a textpad), and import it as ImportArchive in Repository.
The problem with this is that it inserts CDATA elements after the graphical mapping which means your mapping will probably fail.
I'm not sure what you mean by "small boxes", but sometimes "returns" are displayed as small boxes in the monitoring (if you take "view source" on your message). To make these boxes disappear, you can create an ABAP mapping and use the Function Module SCP_REPLACE_STRANGE_CHARS to remove this. It seems that you want these boxes to remain, maybe you can explain why these boxes should follow the message?
regards Ole Mugaas
Thanks for your reply,
Yes my scenario is from SAP(Proxy) to Database(JDBC). The data in SAP came from a conversion run, and during conversion run some of the charaters like '==>' was stored in SAP as '□□□□' . So when the interface is run from SAP '□□□□' also comes along. and the mapping fails giving the error 'XML Parser Exception'. Process teams wants us to transmit the data the way it is in SAP, even if it contains special charaters.
So please advice me what to do.
The special charaters are coming only in one description field.
I have never used ABAP Mapping before, how do i go about doing it. If this is required.
Can't I do this in Graphical mapping, cause it's for only one field.
Regards,
XIer
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.