cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

0 Likes
View Entire Topic
aashish_sinha
Active Contributor
0 Likes

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

Former Member
0 Likes

My receiver is SFTP..so i think i can try with Danielle post..

Thanks

Dinesh

aashish_sinha
Active Contributor
0 Likes

you can try with my way also..

Regards

Aashish Sinha

baskar_gopalakrishnan2
Active Contributor
0 Likes

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);

Former Member
0 Likes

Thnx for everyone help