Dynamic Filename on Receiver File Adapter
Hi,
I am running XI 3.0 SP 14.
The scenario is
SAP R/3 (IDOC) > XI (Receiver File Adapter)> FTP Server
There is no mapping on the XI side, we just drop the IDOC XML on to the ftp server.
I would like to configure a dynamic file name on the Receiver File Adapter where if the 'MSATZ' Field
within the E1EPD04 segment of the IDOC is populated then I would like to send a separate
Filename than the one specified on the 'File Name Scheme'.
Has anybody done this or any suggestion how I should go about this please.
Thank you.
Warm Regards,
Ranjan
Hi Guys,
When I tried to create the User defined function as below, I got the Null value for the "StreamTransformationConstants.DYNAMIC_CONFIGURATION" object.
My code looks like this,(this is part of the debuging code)
Start
public String Create(String a,String b,Container container){
if (container.getTransformationParameters() == null)
return "conf.null";
if (container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) == null)
return "Dynamic.null";
return b;
--End
On the output I get the value "Dynamic.null". I do not know why the object value is Null.
Any suggestion pls.
Thank you.
Warm Regards,
Ranjan
Similar Messages
-
Dynamic Filename for Reciever File Adapter
Hi All,
Can anyone answer to some of my quesries which are as follows
a) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value. I
search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e.
u201CAssuming that the following have been done and configured.
1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
c) .Can we trigger an RFC asynchronously and how?
Your help is highly appreciated and
Regards
Faisal
Edited by: Abdul Faisal on Nov 19, 2009 8:53 AMa) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value. I
search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e.
Hi Use dynamic configuration UDF to create file name dynamically.its very easy search in sdn you will find the code,even you can create file directory name dynamically.
In receiver file communication channel if you use PayLoadZipBean it will do Zipping of your message,for this you need to add this bean name additional parameters section in Receiver Channel.
If you want to create zip file based on pay load value check the condition at mapping level based on that call the service,if you not required zip file in other case for that you need to create one more file receiver communication channel.
u201CAssuming that the following have been done and configured.
1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
not claer,can you explain bit more
2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
We can use all mappings single scenario,how mean just add the mapping names in Operation/Interface mapping.
As per my understanding Message Mapping works faster then JAVA then XSLT then ABAP,but it depends on how many lined of code you written.
c) .Can we trigger an RFC asynchronously and how?
Yes we can use RFC Asynchronous,search in sdn you will find it,if unable to find let me know.
Regards,
Raj -
Dynamic filename in receiver AS2 adapter in B2B Add-on
Hello Experts,
Can you please let me know how we can put dynamic filename in the receiver AS2 adapter for B2B Addon on SAP 7.4.
Thanks
SaurabhHi Ryan / Experts,
Let me explain you in more detail.
In the receiver AS2 Communication channel, if I keep the Filename field as blank as shown below, then in the Mendelson inbox folder, a file is generated with the name "ASJAVA_DX5" which is my business component name.
If I fill the filname field for example with "CONTRL", then in the Mendelson inbox folder, a file is generated with the name "CONTRL".
This is my requirement because, suppose i trigger this interface "first time", a file with static name (ASJAVA_DX5/CONTRL ) would be generated in the inbox folder. If I trigger this interface "second time", since the file already exists with same name, it is not overwritten and I cannot check the output of 2nd trigger . Contents are not overwritten.
To solve this problem + as a general requirement, I wish to have this name to be dynamic, atleast with date+timestamp.
Can you please help. -
Dynamic Filename in Receiver mail adapter is it possible without module?
Hi,
I need to send the file name in email adapter dynamically.Presently iam getting the filename as untitled.xml in the email .The keep attachments is checked in the mail adapter.
I need to rename the file based on the input field name and timestamp .for example if i get the input field xxxx then the filename should be set as xxxx + timestamp .xml.I tried to use the UDF for dynamic configuration but it didnot help me out.Please help me.
Thanks
RajeshUse below code snippet... It should work. If you want timestamp different change accordingly. Currently I do date followed by time as per my requirement.
SimpleDateFormat simpledatFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String datewithYear = simpledatFormat.format(date);
SimpleDateFormat simpledatFormat1 = new SimpleDateFormat("HHmmss");
Date date1 = new Date();
String datewithMs = simpledatFormat1.format(date1);
DynamicConfiguration conf = ((DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION));
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String oldFileName=conf.get(key);
String valueNew;
if( oldFileName == null){
valueNew =oldFileNamedatewithYeardatewithMs+".xml";
//set the new filename
conf.put(key, valueNew); -
Dynamic naming of receiver file adapter
Hello Friends,
How to handle the dynamic file naming in XI at receiver side as file naming convention sequence to be incremented for every 1 hour...
my Client expecting to handle at mapping...How to do this...
Could any one give me the program if we need to do it in java...
and pls also give another approach if any
Setup dynamically ,>>as file naming convention sequence to be incremented for every 1 hour.
Please elaborate this point. I'm again seeing same the question from your side.
From Variable Substitution you can access only ASMA and can refer the payload element. But in the requirement is something else the you should have to go for Dynamic Configuration in Mapping program.
Thanks
Farooq
Edited by: Farooq Farooqui on Aug 16, 2008 12:11 AM -
Variable Substitution - dynamic names in receiver file adapter :)
Hi,
anyone tried this new feature yet?
Variable Substitution
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
I hope it's working fine it may be a good answer to many questions on the forum:)
I can't wait till I get my hands on XI SP12:)
if anyone has a document the describes <b>all</b> of the changes that came with sp12 please post the link
Regards,
michal
Message was edited by: Michal KrawczykHi,
I can't wait to test the new test tool
http://help.sap.com/saphelp_nw04/helpdata/en/6b/874a4273bb3830e10000000a155106/content.htm
it looks like a very helpful thing
come on, come on I want my sp12:)
Regards,
michal -
Dynamic File name in Receiver File adapter
Hi,
My Scenario is Proxy to File.
I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
How can i create a dynamic filename? i searched the forum, but i could not get the correct answer,
Please help me out.
Regards
SrinivasHi Srinivas,
> My Scenario is Proxy to File.
> I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String MyFileName = sono + div + "<filename>"+".xml";
conf.put(key, MyFileName);
return MyFileName;
File name you can format according to your requirement.
And one more thing for this you have to specify the ASMA properties. For this check the below link step-1 and step-2.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards
Ramesh -
Dynamic File Name for Receiver File Adapter
Hi All,
How can we use dynamic name for Receiver file adapter?
Can anyone help.
Thanks in Advance
ChemmanzHi Chemmanz,
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Regards,
Bhavesh -
Setting dynamic file name in Receiver file adapter - not from payload
Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
Please let me know if you remember this.
Thanks a lot,
Viktor Vargaalso u can check in
<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a> -
Error dynamic File Name in Receiver File Adapter
Hi all,
Dynamic file name for Receiver file Adapter Problem
my multi mapping look like this in design mode
messages
message1
SD01_E
FileName
row
message2
SD02_E
FileName
row
by processing the xml look like this:
<ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
or
<ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
in file receivere adapter i have try this but it dos not work
payload:SD01_E,1,FileName,1
Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
is there any way to have access to Filename in different root elements??
regards
RalfHi Ralf,
i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
Regards,
Udo -
How to generate file name dynamically in receiver FIle adapter? Please help
Dear Experts,
I have a scenario where I need to generate output file with the name dynamically pulled from the XI payload.
In receiver File communication channel I don't see any option where we can specify the XML path for the file name.
For example:
If my inbound XML structure (inbound interface) is like below:
<filename>file123.txt</filename>
<RootNode>
<Element1>Product123</Element1>
<RootNode>
From this I need to pick the filename value and generate the output file with the same value.
How can I achieve this? Please help!
Thanks & Regards
Gopal
Edited by: gopalkrishna baliga on May 3, 2011 1:10 PMGopal,
You can use DynamicConfiguration class for this.
You need to write UDF for this and with input of filename you want to set and map this UDF to the top level node.
Refer the below famous blog from Micheal:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
You can also use Variable substitution to get value from payload, search SDN on this.
--Divyesh Vasani -
Dynamic construction of temporary filename for receiver file hcannel
Hi,
We are using a receiver file channel and we need to populate the temporary file name dynamically , in the message mapping (similar to main file name and folder).
Please let me know as to how to achieve this in message mapping and what configuration needs to be done in the receiver file channel.
Regards
GaneshHi,
A way to fetch File name Dynamically (from source File Adapter) in message mapping is through a UDF and then pass this Filename in XML payload of your message.
Then this Dyanamic File name can be put into Receiver File Adapter by configuring Advanced Tab in Receiver File Adapter as explained in this Link:
under Advanced Tab Page
http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
UDF is as Follows:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String valueOld = conf.get(key);
return (valueOld);
This code fetches File Name of the files picked up by Sender File Adapter.Give a suitable file name in Sender as "*.txt" or anthing you wish.
If you find the information helpful, rewards points.
Thanks,
Anurag Garg -
The same filename from a sender to a receiver file adapter
Michal has provided us with a brilliant <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14. I guess a lot of people have been waiting to do this. However, I have a slightly different scenario. In this case, XI is used as a medium to transfer a PDF file from one directory to another directory. There is not transformation or mapping involved.
The message is send by File Sender Adapter and received by File Receiver Adapter. Message type is created as a simply type hexBinary. The file is supposed to be picked up as a PDF and received as a PDF, retaining the same file name. As such, the file name is neither stored in the source structure nor the target structure.
Once the PDF file is transfered into target directory, it should be able to be open by using Acrobat directly without further conversion.
We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
Any feedback is highly appreciated.Hi
>>We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
No, adding file name would not hamper the properties. You can name *.pdf or something else.
For that matter any file pdf, word, .msg format etc can be transferred by this approach. We have tried it.
Earlier to SP14 you cannot give the same name to outgoing file without writing a Adapter module. But things are easy with SP14.
Cheers,
satish -
Receiver File Adapter - Dynamic FTP Server Address
Hi, I would like to pass the FTP Server address to the Receiver File Adapter as an parameter. Is this possible and if so what Name Space / Parametr Names add to the Product to define these values.
Thanks
AndreHi Andre,
If you have your server as a part of your payload, thendynamic file server generation concept can be done is as follows.
In your server name field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Regards,
Bhavesh -
The same filename from a sender to a receiver file adapter - SP14
Hi Expers,
I Have Gone through the link which is given bu Michal.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Here My Questions are.........
1.Should we give any file name in the receiver side Adapter in this scenario.?????
2.How wil be the Sender and Receiver Communication channel Parameters????
What Are they???????
Please Clarify me...
Regards
KhannaHi Rajesh,
Is your query related to sending the file name from the source xml document to the reciever file adapter. If so this can be achieved.
Pls. do the following.
1. In the mapping program that you are using populate the filename coming from the source into the target root element.
2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time
3. To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.
<b>Note: You donot need to specify any filename in the receiver communication channel.</b>
To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
Create an simple user defined function in the mapping and use the following code.
Imports: com.sap.aii.mapping.api.*;
Parameter: String filename
Paramter: String filename;
filename = fileName + ".DAT";
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, filename);
return filename;
You donot need to hard code the value of the filename in the file adapter for your interface.
In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.
Thanks
Indranil
Maybe you are looking for
-
I set a restrictions passcode and have completely forgotten it. I have tried to reset with iTunes but it just clears out my phone and when I turn it back on its still locked in the restrictions menu. U can't do a reset on your phone without it... So
-
sorry for the long headline, but can't figure out how to shorten... i'm using photoshop CS 5.5. the image below is the result of making a change, zooming in and the redraw created this: as i zoomed out, the image progressively filled into normal by t
-
Re: Basic rate + excise duty.
Hi guru's. My enduser want to have a list of basic rate & its excise duty, for a particular vendor. its urgent please. thanks tuljasingh.
-
Cannot install/uninstall/debug my app
Hi, when I was trying to install my app from Store yesterday, WP8.1 Silverlight app on Lumia 1520 with 8.1 Dev Preview, the installation got stucked and I had to restart my phone. After the restart I can no longer install this app from Store, it alwa
-
How can i select spell-check in google chrome
How can i set up spell-check in my google chrome?