Hi Friends,
Can anyone please provide me the UDF for the following case.I need my output file name in following format
156WE_YYYYmmddHHMMSS.xml
Thanks for quick help..
Regards,
Dinesh
Request clarification before answering.
Hi,
In the target file adapter, you can choose target file name as 156WE_.xml, then in next tab choose ADD time stamp. It will create a output filename as 156WE_YYYYmmddHHMMSS.xml, if values till underscore is fixed.
Else you can use below code.
/* Using Dynamic Configuration */
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//conf.removeAll();
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//String filename= conf.get(key);
conf.put(key, fileName);
key= null;
return fileName;
Refer link --- http://wiki.sdn.sap.com/wiki/display/Snippets/SAPXIDynamic+Configuration
Regards
Aashish Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this code snippet ...
Date date = new Date(); // get the current date
DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss"); // set the format
String concat ="156WE_" + df.format(date);
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,concat);
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.