on 02-05-2009 5:43 AM
Hi friends,
Working first time with xslt map.I am doing a Idoc to File scenario in which I need to pass Idoc number as the file name dynamically. Right now I am just trying to send some constant value 'ABCD' to go in dynamic attribute filename.
I used the code which has been provided over here.
[http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm]
I just changed the "Directory" with "FileName" in the code. It is not generating the dynamic attribute http://sap.com/xi/XI/System/File
This is my xsl code. Please suggest me If iam doing anything wrong.
-
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:output indent="no"/>
*<xsl:param name="inputparam" select = "ABCD"/>*
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/">
<!-- change dynamic configuration -->
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
*<xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>*
<xsl:variable name="dynamic-value" select="dyn:get($dynamic-conf, $dynamic-key)"/>
<xsl:variable name="new-value" select="concat($dynamic-value, 'subfolder\')"/>
<xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
<!-- copy payload -->
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="/">
-
Waiting for your answers.
Thank you.
Deepthi.
The example from online helps reads a value from dyn. config. and changes the value.
When you just want to write a value, do like this:
<xsl:param name="inputparam" />
<xsl:param name="new-value">
<xsl:value-of select="?IdocNumer?" />
</xsl:param>
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')" />
<xsl:variable name="dynamic-key" select="key:create ('http://sap.com/xi/XI/System/File', 'FileName')" />
<xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
Instead of ?IdocNumer? put the XPATH of that value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefen,
I tried the way you suggest but still I couldn't able to see the Dynamic Configuration attribute in SOAP document. I tried for Idoc number and even tried by passing just a value 'abcd' like below.
-
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:output indent="no"/>
<xsl:output method="text" encoding="utf-8"/>
*<xsl:param name="inputparam"/>*
*<xsl:param name="new-value">*
*<xsl:value-of select="/WMMBID01/IDOC/EDI_DC40/DOCNUM" />*
*</xsl:param>*
<xsl:template match="/">
<!-- change dynamic configuration -->
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
<xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>
<xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
-
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:output indent="no"/>
<xsl:output method="text" encoding="utf-8"/>
*<xsl:param name="inputparam"/>*
*<xsl:param name="new-value" select="abcd">*
*</xsl:param>*
<xsl:template match="/">
<!-- change dynamic configuration -->
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
<xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>
<xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
Any suggestions please.
Thanks
Deepthi.
The only difference I see to my mapping is the line
<xsl:template match="/">
which is above the parameter statement like this:
<xsl:template match="/">
<xsl:param name="new-value">
<xsl:value-of select="/WMMBID01/IDOC/EDI_DC40/DOCNUM" />
</xsl:param>
Are you working with PI 7.1? Then you have also to set parameter "use sapxmltoolkit" in operation mapping.
Hi Stefan,
I am working on PI 7.0. I made the change which you suggested and still no use
Here is the main code. Please help me whether I am doing anything wrong.
-
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:output indent="no"/>
<xsl:output method="text" encoding="utf-8"/>
*<xsl:param name="inputparam"/>*
*<xsl:template match="/">*
*<xsl:param name="new-value">*
*<xsl:value-of select="/WMMBID01/IDOC/EDI_DC40/DOCNUM" />*
*</xsl:param>*
*<!-- change dynamic configuration -->*
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
<xsl:variable name="dynamic-key" select="key:create('http://sap.com/xi/XI/System/File', 'FileName')"/>
<xsl:variable name="dummy" select="dyn:put($dynamic-conf, $dynamic-key, $new-value)"/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="/WMMBID01/IDOC/E1MBXYH"/>
<xsl:apply-templates select="/WMMBID01/IDOC/E1MBXYH/E1MBXYI"/>
</xsl:template>
<xsl:template match="E1MBXYH">HEADER:<xsl:value-of select="USNAM"/>;<xsl:value-of select="BKTXT"/>
</xsl:template>
<xsl:template match="E1MBXYI">
ITEM:<xsl:value-of select="MATNR"/>>WERKS<xsl:value-of select="WERKS"/>;My constant
<xsl:value-of select="/WMMBID01/IDOC/EDI_DC40/SNDPRN"/>
</xsl:template>
</xsl:stylesheet>
-
Thanks
Deepthi.
Edited by: deepthi reddy on Feb 9, 2009 12:54 AM
Hi,
in ID in reciver file comm channel, have you checked the Adapter specific msg attributes and checked the FileName option...........
Regards,
Rajeev Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.