Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling Function Module "Read_Text" in XSLT transform

Former Member
0 Likes
763

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">

&lt;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>"

&lt;/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:

TDTDLINE
*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">

&lt;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>"

&lt;/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:

TDTDLINE
*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

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
492

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