cancel
Showing results for 
Search instead for 
Did you mean: 

How to pick up the file based on Current date ?

Former Member
0 Kudos

Hi All,

we have scenario File --> Proxy, where files are placed into file sender system with file creation date, our requirement is picking the files based on current date. For example ,

               abc1_20130401.txt

               abc1_20130402.txt

              abc1_20130403.txt

Please suggest me ,how to  pick up the file based on today date (in this case current date - 20130403) only.

what are the file patteerns that can be suitable for picking up the exact file or any other solutions ?

what are the options with FTP adapter ..?

Is there any possibility to achive this by using SFTP sender adapter ?

Thanks

Dhileep.

Accepted Solutions (0)

Answers (8)

Answers (8)

former_member184789
Active Contributor
0 Kudos

Hi,

Check out this thread too for this requirement:

http://scn.sap.com/thread/1725145

BTW, will it be possible to have an archive & delete folder?? Then it will be easier for you as the files processed today will not be there in the source folder tomorrow for picking by the file adapter..

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Here is my few cents.  Use script and basically search google to find files based on date.  You need to use a) find command to pick files based on the date and b) move or copy command those files to an another directory.  Config file adapter to reference the other directory. This is one approach. If your files are dropped at the directory throughout day then run a cron job for that script to do above action.  you don't need to do anything at PI level. Take help from unix team.

former_member205101
Participant
0 Kudos

Hi,

We have to use file adapter and Proxy...There is no doubt about it.

Example Flow:

FTP server-->File Adapter--> PI-->Proxy-->ECC

OS Level commands (Script) used in File adapter channel to implement this logic "picking the files based on current date."

Thanks

Praba

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

I dont think OS level script will work because you have to execute mapping and sending as Proxy request.If you do it using OS level then how you could make proxy call to send data to ECC.

Thank you,

Raj

former_member205101
Participant
0 Kudos

Hi Dhileep,

As other folks suggested , OS Level commands solution is feasible one.

Please refer below Wiki Link, It may help you reg. OS Commands in File adapter.

http://wiki.sdn.sap.com/wiki/display/XI/SAP+XI+File+Adapter+OS+Command+Line+Feature

Thanks

Praba

sugata_bagchi2
Active Contributor
0 Kudos

Hi Dhileep,

OS Scripting would the best feasible one.

nabendu_sen
Active Contributor
0 Kudos

Hi Dhileep,

Pi does not have any straight solution for this requirement. Its better if you go for OS Command.

gagandeep_batra
Active Contributor
0 Kudos

hi dhilleep,

you can go for another option also if you have NFS ,

use processing mode as "Set to Read only"

or

go for Run OS commands,

if it is FTP then go for archive it's a best option

for SFTP you can go for adapter module to archive the file,

check below thread that may help:

http://scn.sap.com/thread/2001133

Regrds

Gagan