cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.1 XSLT and ASMA

Former Member
0 Kudos

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

<xsl:stylesheet version="1.0" xmlns:xsl="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 -->

<xsl:variable name="dynamic-key" select="key:create('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>

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Holger,

Hope you are doing an end to end testing and not local testing in ESR. Local testing will not work, as the dynamic configuration values are available only at run time.

Also check that the sender adapter is having ASMA parameters checked

Regards

Suraj

holger_stumm2
Active Contributor
0 Kudos

found it, was an error in the code:

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

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

double quote single quote in a row!

cheers

Holger

Answers (0)