cancel
Showing results for 
Search instead for 
Did you mean: 

Change name of output file.

seVladimirs
Active Contributor
0 Kudos

Hello.

I'm a new in PI.

I have created communcation channel:

adapter type: FILE.

transport protocol: FTP

then I defined target directory and file name scheme.

In proccessing tab I choose Add Time Stamp. File was created in my directory, but with this name XXX20100618-153919-672.dat.

Can I somehow change the name of file like

 XXX[ddmmyyyy][mmtt].dat 

?

Thanks a lot!

Edited by: earnestik on Jun 22, 2010 6:49 AM

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

> In proccessing tab I choose Add Time Stamp. File was created in my directory, but with this name XXX20100618-153919-672.dat.

>

When you select Add time stamp the output file name come like that only,so chnaging name to your desired format at cc level not possible.

> Can I somehow change the name of file like

 XXX[ddmmyyyy][mmtt].dat 

?

Try with Dynamic Configuration UDF, in message mapping,then we can achieve this one easily.

String filename=XXX;

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); 
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName"); 
 
SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMdd");
String timestamp = dateformat.format(new Date()); 
String newfilename=fileName+timestamp+".dat";
 
// change to new file name
conf.put(key, newfilename);
return "";

some small changes required in above code, do it your slef,

if you dont know how to use Dynamic Configuration UDF search in SDN.

Regards,

Raj

Answers (0)