cancel
Showing results for 
Search instead for 
Did you mean: 

How to pick the Latest File from the source directory

Former Member
0 Kudos

Hi ,

I have requirement that is File to RFC scenario......i hhave to pick the file based on Daily based... this I achived through based on Availability Times Scenario is working fine..

But the problem is.. My file adapter is picking all the files from the source directory

But I want to pick the Latest file only (based on Time stamp) file name is (JINP_20080619 082030) so, based on time stamp which is the latest one that file only i wnat to process..

any suggestions on this.. how can i achive this requirement...

Regards

Jain

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use the 'Archive' functionality in the File adapter.

What it does is instead of keeping the file in the same folder it will move you file in another folder so that in your source folder you will find only one file at a time and it will solve your problem.

Currently I would like to know, what you do after reading the file.

Gaurav Jain

Reward Points if answer is helpful

Answers (3)

Answers (3)

Former Member
0 Kudos

Solved

Former Member
0 Kudos

Hello

the Archive functionality in the File adapter will resolve your problem.

by this you will be able to move all your old file to other folder and the latest file will be availble at your FTP and by adding the time stamp you will be able to cross check tht wther the file is latest or not.

Edited by: Chetan Ahuja on Jun 20, 2008 6:18 AM

Former Member
0 Kudos

Hi Gaurav , and Chethan

After picking the files I'm already processing the files into Archive directory.. but the requirement is.. from the source I'm getting files along with the new data getting old data also.. so.. which is the latset file.. that single file is enough to process .. insted of processing all other files... after process that file I'm doing Achive.. so... in the next day.. along with thesefiles some other files they will generate.. from those files.. again i want to pick whicjh is the Latest file(based on Time stamp) so, for this. any solution...

thanks

Jian

Former Member
0 Kudos

Jain,

You are correct. Archive or other dynamic config setting here will not help you. Probably you could try this. Place a dummy file in the input folder and poll for that file (using the same availablity time you are currently using). Use OS cmd before msg processing to invoke a script. THis script will delete all other files except the latest one. I am not very good at scripts. But I guess this should be possible.

Create a new adapter module and add it to the module chain. This adapter module will pick the undeleted file and add it to the XI message.

Regards,

Jaishankar

Former Member
0 Kudos

Thanks Jaisankar,

Is there any other solution.. because I dont have any idea to write the script or oscommand.. any other will be really appriciated...

Regards

Jain

Former Member
0 Kudos

Hi Jain (Ajay ),

Another possibility is that after XI reads the file, you set the Sender File adapter-->Processing Mode --> Set to Read-Only.

○ Set to Read-Only

Successfully processed files are given this attribute. Only writable files are processed. This selection is only available for the File System (NFS) transport protocol.

http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

Hope this will help you.

Former Member
0 Kudos

>>Another possibility is that after XI reads the file, you set the Sender File adapter-->Processing Mode --> Set to Read-Only.

How does this option help the problem in hand?

@Jain,

I dont think you have any other option.

Regards,

Jaishankar

Former Member
0 Kudos

Hey,

Check out the Source File Timestamp in adapter specifici attributes..

Details document on the parameters passed to a senderfile adapter

http://help.sap.com/saphelp_nw04/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm

Thanks,

Vijaya