cancel
Showing results for 
Search instead for 
Did you mean: 

Xslty mapping

Former Member
0 Kudos

Hi all,

can we increment a variable in the xsl mapping program each time it is executed?

Regards,

Archana

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Archana,

Every Interface run in XI is going to be independent of the other. So you cannot have any such global variable unfortunately.

So, one option would be to have an entry in an ABAP table, and then use an RFC make an RFC call to increment the table value and so on.

Regards,

Bhavesh

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi Archana,

yes you can do that. With a recursiv template, for example: [code]

<xsl:template match="/">

<xsl:call-template name="zaehler">

<xsl:with-param name="i" select="1"/>

<xsl:with-param name="imax" select="5"/>

</xsl:call-template>

</xsl:template>

<xsl:template name="zaehler">

<xsl:param name="i"/>

<xsl:param name="imax"/>

<xsl:value-of select="$i"/><br />

<xsl:if test="$i &lt; $imax">

<xsl:call-template name="zaehler">

<xsl:with-param name="i" select="$i+1"/>

<xsl:with-param name="imax" select="$imax"/>

</xsl:call-template>

</xsl:if>

</xsl:template>[/code]

Regards,

Udo