on 02-13-2009 5:52 AM
Hi Friends,
I had a requirement where i had to generate file name at target side with the following format
" raw_text_yyyymmddhhmmss.txt" . This can be acheived by using "currentdate" function but there is no field at target side which holds this value, if there was a field then i would have used variable substitution method to generate the file name.Another option is Dynamic Configuration UDF already
my root node is mapped to some src field say FLD1 based on which i will be getting multiple files.
How to customise this udf to get current date as filename for multiple target files:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String Outputfile = conf.put(key,a);
return Outputfile;
Regards,
Vinod.
can you map output of this UDF to any of the NODE in your target structure that has occurrence 1..1.....so that it will not be already mapped ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you want just the outputfile with the date and time stamp, You can just provide the target file name as " raw_text_.txt" and then under the parameters tab> File construction Mode> Select Add time satmp which will append the file name along with the time stamp.
Try this I dont think you require the UDF.
Regards,
Nithiyanandam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nityanand,
Your solution is right but actually problem here is recently a slight change was made for file name it should be "raw_text_yyyy-mm-dd-hh-mm-ss.txt" by using variable substitution we get file name as this format "raw_text_yyyymmddhhmmss.txt" .
@Prateek: I cant give Currentdate as direct input to udf becoz we are generating files based on a certain field from source side.We are sorting this multiple source fields and generating target files.
Any suggestions.....
Regards,
Vinod.
Have you tried providing the currentDate value as direct input to the DynamicConfiguration UDF?
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.