on 03-13-2009 4:54 AM
hi experts,
My scenario is IDOC to Flat file in which IDOC is converted to a flat file using XSLT mapping and sent to FTP location.
but the file name should be a field value of IDOC. FOr that i m using variable subtitution at receiver channel.
My IDOC structure is
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaideep Baid,
As you are doing IDOC to FLAT FILE, and if u want to use Variable Substitution, Always remember that Variable Substitution should be defined for Target Structure.
As receiver is FLAT FILE and you want to fetch the Value from the Source Structure, then Use Dynamic Configuration and Enable ASMA
Regards,
Varun
Edited by: Varun Reddy on Mar 13, 2009 10:48 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can either store the filename in a field in the receiver message and use variable substiution or use the Dynamic configuration UDF to set the filename. To do dynamic config using xslt refer this http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm
Thanks,
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Experts,
My scenario is IDOC to Flat file in which IDOC is converted to a flat file using XSLT mapping and sent to FTP location.
but the file name should be a field value of sender IDOC. For that i am using Variable subtitution at receiver file channel.
My IDOC structure is :-
<SHPMNT04>
<IDOC Begin="">
<EDI_DC40 Segment="">
<TABNAM>
<MANDT>
<DOCNUM>
<>......
here DOCNUM should be file name of receiver flat file.
I am giving file name is
output%var%_.txt
In Variable substitution table values are
variable name-------var
reference -
payload:SHPMNT04,1,IDOC,1,EDI_DC40,1,DOCNUM,1
But i m getting error is :--
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Caught SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 45, 44, 49(:main:, row:3, col:9)
Please help me out.
Thanks
Jaideep Baid
Hi Jaideep,
You can use Variable substitution only from the values from the receiver payload. If you requirement is to set the file name from the sender payload then the only option is using Dynamic Configuration.
You can create a UDF to set the file name using dynamic configuration and call this Java UDF from XSLT mapping program. Refer this link to call a Java function from XSLT mapping http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm.
Thanks,
SaNv...
Hi,
Store that field name into a STRING in Source side variable ,and mapp that variable to target side variable and use Variable Substituation...
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ram,
Thanks for your response.
I tried same thing my req. is to retrive a fiels value from input IDOC and append that value in output flat file name.
I tried below code in my XSLT mapping:--
<!--xsl:param name="UniqueID">
<xsl:value-of select="/SHPMNT04/IDOC/EDI_DC40/DOCNUM"/>
</xsl:param-->
<xsl:template match="IDOC">
<!-- change dynamic configuration -->
<!--xsl:variable name="dynamic-conf"
select="map:get($UniqueID, '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, 'syng204rydtm.')" />
<xsl:variable name="dummy"
select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" /-->
<xsl:apply-templates/>
</xsl:template>
Error i got is :--
avax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Illegal number of arguments or types of arguments in a call of function 'map:get'. at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:251)
Please help me out.
Thanks
Jaideep Baid
the best is to enhance your existing XSLT mapping to accommodate Dynamic configuration;
store the docnum in a variable and set that value as the filename.
ref:
http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htmmake sure
make sure you have declared;
<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">
hi Shabarish,
I have modified code as u told.
<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:http://testdevsyngenta.com" 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:variable name="UniqueID">
<xsl:value-of select="/SHPMNT04/IDOC/EDI_DC40/DOCNUM"/>
<xsl:variable-->
<xsl:template match="/">
<!-- change dynamic configuration -->
<!xsl:variable name="dynamic-conf"
select="map:get($UniqueID, '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, 'syng204rydtm.')" />
<xsl:variable name="dummy"
select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
</xsl:template>
Still I m getting same error
Call XSLT processor with stylsheet MM_SHPMNT04_To_FlatFile.xsl.
TransfromerException during XSLT processing:
javax.xml.transform.TransformerException: com.sap.engine.lib.xml.util.NestedException: Illegal number of arguments or types of arguments in a call of function 'map:get'.
Please help me out
Thanks
Jaideep
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.