cancel
Showing results for 
Search instead for 
Did you mean: 

Static function in XSLT

Former Member
0 Kudos

Hi,

Could somebody tell me if i can embed a static function (ABAP) in an XSLT.

Thanks in advance

Rachana

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Thanks a lot and this should help me. But I'm not that well-versed in XSLT.

Hence,

I'm getting an xml namespace not defined error now.

my XSLT looks like this

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:strip-space elements="*"/>

<xsl:output indent="no"/>

<xsl:template match="TaskType">

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values>

<TASKTYPEDESIGN>

<SBTM_CR_TT_DESIGN>

<ORIGINAL_LANG>

<xsl:value-of select="../@origLang"/>

</ORIGINAL_LANG>

<sap:call-external class="CL_SBTM_XML_CONVERSION" method="GET_SYLANGU">

<sap:callvalue param="EXTERNAL" select="../@language"/>

<sap:callvariable param="INTERNAL" name="SY_LANG"/>

</sap:call-external>

</SBTM_CR_TT_DESIGN>

</TASKTYPEDESIGN>

</asx:values>

</asx:abap>

</xsl:template>

I tried to fit in that code there...but i guess this is not the way.

please help

Former Member
0 Kudos

You need to change the first line as below.

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:sap="http://www.sap.com/sapxsl"

version="1.0">

Cheers

Rob

athavanraja
Active Contributor
0 Kudos

check this online help on calling function modules / methods of class from XSLT program

http://help.sap.com/saphelp_nw04/helpdata/en/76/084e3ce0f9fe3fe10000000a114084/frameset.htm

code snippet (taken from above link) for calling a method

[code]<sap:call-external class="CL_FLIGHT_INFO" method="GET_DETAIL">

<sap:callvalue param="AIRLID" select="string($carr/@code)"/>

<sap:callvalue param="CONNID" select="string(@code)"/>

<sap:callvalue param="FLDATE" select="string(departure/date)"/>

<sap:callvariable param="FLIME" name="duration"/>

<sap:callvariable param="DIST" name="distance" type="number"/>

<sap:callvariable param="UNIT" name="unit"/>

<sap:callvariable param="PLTYPE" name="planetype"/>

<sap:callvariable param="SEATSM" name="seatsmax"/>

</sap:call-external>

[/code]

Former Member
0 Kudos

Hi,

You mean, you want to call the FM which is R/3 from Program(calls the XSLT) which is in CRM?

If you want to call the FM(From R/3) to CRM(Program which calls the XSLT. Not inside the XSLT),

Create the RFC function module, put the FM which does the date calculation. Then call the RFC FM from CRM with RFC DESTINATION.

CALL FUNCTION 'ZCAL_DATE' DESTINATION....

<b>Reward points</b>

REGARDS

Former Member
0 Kudos

Hi,

I read somewhere that I can call an R/3 Static function or may be a functional method within an XSLT.Is that possible?

I'm trying to read a language field (which comes as "EN" or "DE" in an XML) into a SPRAS field which is only single character. Is there anyway for em to directly get this done ?

Regards

Rachana