cancel
Showing results for 
Search instead for 
Did you mean: 

How to archive the multiple files in multiple directories in FTP communication channel

azeem_syed2
Explorer
0 Kudos

Hi Experts,

I have one new requirement

its a FILE to Proxy scenario.

I am picking the files from multiple directories and placing in one archive directory.

Now the requirement is--- I need to pick the files from multiple directories and archive to multiple folders.

But in SAP PI standard communication channel we can place the all files in one archive folder.Can you please let me know how to write batch script for this scenario.

We are using FTP channels and its a windows server.

Can you please give the sample code for that and also let me know where I need to place the batch file(AL11 server in sap PI or FTP windows server)

Regards,

Azeem

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The Azeem ,

Another way will be to create one interface which picks up files from archive directory and route files using there name to different directories.

Thanks.

diego_gabriel
Participant
0 Kudos

Hello Azeem,

Can you use only batch script?

You can use other solutions, please take a look here and here

Maybe these blogs can be helpful and give you some ideas.

Regards,

Diego

azeem_syed2
Explorer
0 Kudos

Hi Diego,

Thanks for your quick response..

There is any OS command script (Batch file)to fulfill the requirement....?

Regards,

Azeem

diego_gabriel
Participant
0 Kudos

Hi Azeem,

Basically in your receiver channel add your script i.e. \script.bat %FileName%

Your script should look like:

copy \<source>\%1 \target_1\%1

copy \<source>\%1 \target_2\%1

copy \<source>\%1 \target_3\%1 etc, etc...


The script must be in any place where your PI can "see" it.

Just google it. There is a bunch of samples of .bat scripts to copy files.

Regards,

Diego