cancel
Showing results for 
Search instead for 
Did you mean: 

Archiving a file in two different location.

Former Member
0 Kudos

Hello All,

I need your help, Very new to SAP.

How can I archive a file that is picked from a FTP server in two different locations?

Currently it gets achieved in the XI server Archival path. I also want to achieve the file in on a different ftp location, keeping the current archival path unchanged.

The Second archival location would be same as the location from where the file is picked but into a different archival folder.

Accepted Solutions (1)

Accepted Solutions (1)

zameerf
Contributor
0 Kudos

You can achieve this using an additional data flow to have additional receiver channel to place the picked file as it is into the required directory.

Also, you can try to Run OS command option in channel.

Refer below blog to get some idea.

http://scn.sap.com/people/rajasekhar.reddy14/blog/2011/04/19/logging-archiving-and-changing-the-file...

Also, If you are in UNIX, try to give this command in channel if it is same host.

cp %F <Target Directory>

Former Member
0 Kudos

Hello  All

Humble thanks for all your help..I have created the script file all most of you have advised and placed also created the batch file to execute the script file.

But still the message gets archived in 1 location (the archival path as mentioned in Archive directory in sender channel)

I have already placed the batch file in the XI server and placed the path of the batch file in the OS command Line before processing message. But the batch file is not getting executed due to which the file is not getting achieved in the other location.

However if I manually execute the batch file from my desktop where I have created the batch and the script file the second archival process happens all right. But if I manually execute it from the the XI server location.. Nothing Happens..

Please help with how can I execute the batch file automatically what should I put in the OS Command Line

Please find the screenshot attached regarding executing the batch file

gagandeep_batra
Active Contributor
0 Kudos

Hi Promit,

try like below:

cmd.exe /C " D:\folder1\file.bat

and also check for add above command  "RUN OS Command After Message processing."

Regards

Gagan

Answers (4)

Answers (4)

naveen_chichili
Active Contributor
0 Kudos

Hi,

My suggestion is to add one more new channel so that you can archive in other location also.

Regards,

Naveen.

Former Member
0 Kudos

you can have two receiver channels or alternatively u can write a java mapping program to save the file in the ftp locaiton. do let me know if u want the code to ftp the file through java mapping.

0 Kudos

Hi Praveen,

As you have told above,can you please provide the code to ftp the file through Java mapping.

Regards

Atanu Mazumdar

Former Member
0 Kudos

yes please that would be very helpful if you can provide the code

rajasekhar_reddy14
Active Contributor
0 Kudos

Personally i dont recommend to user schell script / JAVA Mapping in your case, best design is add one more receiver and create one more file channel to place file in FTP.

Former Member
0 Kudos

Hi Atanu,

PFB the code that i have written to download the file from FTP location.

http://scn.sap.com/blogs/praveen.sutra/2012/09/10/java-mapping-code-to-connect-to-ftp-location-and-p...

the above code is tested and its working perfectly fine.

Former Member
0 Kudos

Hi Promit,

PFB the code that i have written to download the file from FTP location.

http://scn.sap.com/blogs/praveen.sutra/2012/09/10/java-mapping-code-to-connect-to-ftp-location-and-p...

the above code is tested and its working perfectly fine.

rajasekhar_reddy14
Active Contributor
0 Kudos

Add one more receiver ,create File receiver channel to place file in different archive folder.

Former Member
0 Kudos

Hi,

you can use OS command, or you can do this:

1) develop a simple interface with only ID part that moves files from FTP folder to another destination (for example, an internal FTP area). This interface must also archive files in archival FTP folder.

2) now change  the existing interface: it must pick files from destination specified at point 1 (p.e. internal FTP area). Obviously this interface must archive files.

BR

Fabio