Skip to Content
0
Former Member
Feb 24, 2010 at 10:33 AM

PI 7.1 XSLT and ASMA

134 Views

Hi,

I want to set the file name in the File Adapter as part of an XSLT-Mapping.

The steps are as follows in the XSLT:

1. Set Filename to new filename in ASMA.

2. Check if Month = '1' on payload xml. .

If month = 1 , then copy record in xml, else next record.

-


But I get an error:

Execution of mapping "urn:rlp.de:budgeting/OM_FileIN_to_FileOUT_Budget_1" failed. Reason: MappingException: Mapping failed, TransformException: Transformer exception occurred when executing XSLT BudgetFileNameMap (urn:rlp.de:budgeting, -1, 24903e11-1bce-11df-97ba-ddab0a076144), javax.xml.transform.TransformerException: com.sap.engine.lib.xsl.xpath.XPathException: Illegal number of arguments or types of arguments in a call of function 'dyn:put'., XPathException: Illegal number of arguments or types of arguments in a call of function 'dyn:put'.

The XSLT:

<?xml version="1.0" encoding="UTF-8"?>

http://www.w3.org/1999/XSL/Transform"

xmlns:fo="http://www.w3.org/1999/XSL/Format"

xmlns:ns0="urn:rlp.de:test:budgeting"

xmlns:map="java:java.util.Map"

xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"

xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">

<xsl:param name="inputparam"/>

<xsl:template match="/">

<!--change asma attributes -->

<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />

<!-- create asma key for FileName configuration -->

http://sap.com/xi/XI/System/File', 'FileName')" />

<xsl:variable name="new-value" select="yourfilename.xml" />

<xsl:variable name="fileName" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />

<MT_FileIn_Budget>

<xsl:copy-of select="/ns0:MT_FileIn_Budget/BudgetRecord[Monat=1]"/>

</MT_FileIn_Budget>

<!-- copy payload -->

<xsl:copy-of select="." />

</xsl:template>

</xsl:stylesheet>