2012 Jun 07 5:05 PM
Hi Experts,
I'm a bit new to XSLT tranformation in ABAP. I have this existing code created but its hardcoded in XSLT program.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="ZINVOIC02_MX">
<xsl:for-each select="IDOC">
<StructureA
xmlns="http://www.xxx.xxx.xx/xxx/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xxx.xxx.xx/xxx/2 http://www.xxx.xxx.xx/xxxxx_xxxxxxxx/xxx/2/xxxx22.xsd"
version="2.2"
SeriesA="<xsl:text>textA</xsl:text>"
SeriesB="<xsl:text>textB</xsl:text>"
</StructureA>
</xsl:for-each>
</xsl:transform>
Let put it this way that this code can already convert to XML. Instead of hardcoding the attribute SeriesA and SeriesB to the text mentioned above, I've created a standard text definition as a lookup.
I've created a standard text definition ZTEXT_ST and inside is this:
| TD | TDLINE |
|---|---|
| * | SeriesA : textA |
| * | SeriesB : textB |
Is there a way on how to revise the XLST above to call the standard function module "READ_TEXT" with the corresponding details CLIENT (100), ID (ST), LANGUAGE (EN), NAME (which is ZTEXT_ST) and OBJECT (TEXT) and get the values on the standard text?
<< Moderator message - please do not offer points >>
Message was edited by: Rob Burbank
Hi Experts,
I'm a bit new to XSLT tranformation in ABAP. I have this existing code created but its hardcoded in XSLT program.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="ZINVOIC02_MX">
<xsl:for-each select="IDOC">
<StructureA
xmlns="http://www.xxx.xxx.xx/xxx/2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xxx.xxx.xx/xxx/2 http://www.xxx.xxx.xx/xxxxx_xxxxxxxx/xxx/2/xxxx22.xsd"
version="2.2"
SeriesA="<xsl:text>textA</xsl:text>"
SeriesB="<xsl:text>textB</xsl:text>"
</StructureA>
</xsl:for-each>
</xsl:transform>
Let put it this way that this code can already convert to XML. Instead of hardcoding the attribute SeriesA and SeriesB to the text mentioned above, I've created a standard text definition as a lookup.
I've created a standard text definition ZTEXT_ST and inside is this:
| TD | TDLINE |
|---|---|
| * | SeriesA : textA |
| * | SeriesB : textB |
Is there a way on how to revise the XLST above to call the standard function module "READ_TEXT" with the corresponding details CLIENT (100), ID (ST), LANGUAGE (EN), NAME (which is ZTEXT_ST) and OBJECT (TEXT) and get the values on the standard text?
<< Moderator message - please do not offer points >>
Message was edited by: Rob Burbank
2012 Jun 07 7:27 PM
Hi,
Have a look at SAP Library: XSLT - Additional SAP statements; Commands are sap:call-external (and sap:callvalue, sap:callvariable), sap:external-function (and sap:argument, sap:result), sap:function.
Regards,
Sandra
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |