I need to import an xml file lookgin like this:
<TABLE>
<TABNAME>COMM_PRODUCT</TABNAME>
<FIELDNAMES>
<FIELDNAME>CLIENT</FIELDNAME>
<FIELDNAME>PRODUCT_ID</FIELDNAME>
</FIELDNAMES>
</TABLE>
The above XML has been created using the following XSLT:
<?xml version="1.0" encoding="iso-8859-1"?>
http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xa="urn:schemas-microsoft-com:xml-analysis:mddataset"
xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" />
<xsl:variable name="fieldnames" select="//asx:abap/asx:values/FIELDCAT" />
<xsl:template match="/">
http://www.sap.com/abapxml" version="1.0">
<asx:values>
<xsl:apply-templates select="//ZTESTSWB"/>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="//ZTESTSWB">
<ZTESTSWB>
<xsl:for-each select="*">
<!
column &gt;&lt;xsl:apply-templates&gt;&lt;/column
>
<xsl:copy>
<xsl:apply-templates select="text()"/>
<xsl:for-each select="@FIELDNAMES|*">
<FIELDNAME><xsl:value-of select="FIELDNAME"/></FIELDNAME>
</xsl:for-each>
</xsl:copy>
</xsl:for-each>
</ZTESTSWB>
</xsl:template>
</xsl:stylesheet>
I have also declared an internal table looking like this:
Table: META
Structure:
ZTESTSWB
TABNAME
FIELDNAMES (Reference table type)
FIELDNAME
When using the command
Call transformation with the parameters:
SOURCE XML (xml string)
RESULT ZTESTSWB = META.
the result is :
Format error at the XML Element of type text, name: "{}"
Thank you for your help.
Soeren Baek