on 02-24-2010 10:33 AM
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>
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.