on 08-04-2010 2:03 PM
Hi all
I have a scenario where my sender file adapter should pick up multiple files with different extensions and my receiver file adapter creates the same files but without extension
can anyone provide me the udf for the logic
-keerthi
You can use DynamicConfiguration method to rename the file. [Refer Michal's blog |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2664] [original link is broken];to do some required ASMA settings in Sender & Receiver file adapter and then use below mentioned UDF code to solve your problem.
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String source_file = conf.get(key);
//Below line of code will remove the file extention from the file name
String target_file = source_file.substring(0, source_file.length() - 4)
conf.put(key, target_file);
return "";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Keerthika,
Keep the source directory filename as ., so that it would pick all the files placed in the source directory.
Use the below UDF, to create the target file name
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
String MyFileName = "";
conf.put(key, myFileName);
And in the Adapter specific message attributes in receiver communication channel select the option Filename.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using ASMA..
If you need to pick files with multiple extensions u can mention the same in the sender file adapter by selecting advanced selection for file picking and ther you give all the extensions for example same .txt,.pdfand etc..by mentioning the same folder path.
And in receiver adapater just mention the file name.
Regards,
Sainath chutke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.