cancel
Showing results for 
Search instead for 
Did you mean: 

recive a file with dynamic name

Former Member
0 Kudos

Hi All,

I want to receive a file with dynamic name containing date stamp to it.... eg File_20080123.txt , File_20080122.txt etc.

Can anybody suggest how to do it?

Thanks,

Atul

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>> I want to receive a file with dynamic name containing date stamp to it

does this means you want to pick up the file dynamically?

if yes,then you can give file name as File_* in the sender file communication channel as long as the source directory remains the same.

if you have multiple source directories and you want to pick up files from those directories then reply back so that we can suggest you an alternate way for it

Thanx

Aamir

Former Member
0 Kudos

Thanks aamir,

I guess file_* will solve my problem as directory is fixed....

just a small question on this... What will happen if there are more files like File_1 and File_2 ... and i am executing scenario for file File_*?

Will it pick up all the files? in any sequence perticular sequence....?

Thanks,

Atul.

Former Member
0 Kudos

Hey

if you give the file name as File_* then it will pick up all the files whose names start with File_

First of all a list is generated for all the files which satisfy the criteria and then all of them are picked up

Thanx

Aamir

Edited by: Aamir Suhail on Jan 23, 2008 4:52 PM

Answers (2)

Answers (2)

former_member859847
Active Contributor
0 Kudos

Hi Patil,

The follwoing weblog will be useful for your requirement.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

regards

mahesh.

justin_santhanam
Active Contributor
0 Kudos

Atul,

Are u using mapping program in ur interface? If yes you can go ahead with ASMA + Dynamic Configurations for renaming the file.

Have u tried this option?

See the below Solution

Check the ASMA File for both sender/receiver channels.

Write the below code UDF in mapping program

//Get Input date. Don't pass anything to this UDF except the Date.

//Map the output to the root node of the target.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String fname = conf.get(key);

String ret = fname"_"Date

return "";

raj.

Edited by: Raj on Jan 23, 2008 4:09 PM