cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming the file in FTP server

Former Member
0 Kudos

Hi,

I am trying to rename the file name from .flag to .done in local FTP server. For that I have written the script like below and given the file path in SAP PI receiver communication channel.I am able to create the file in the target directory. But I am unable to rename the file to .done.

File name in the PI receiver channel is /dir/file.bat and tried with cmd.exe /dir/file.bat

Script contains

open domain name

user  username password

RENAME file.flag file.done

quit.

I have tried in several ways but getting the Error executing OS command . Please provide me the solution.

Thanks,
Satheesh

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

Hi Satheesh - The os commands will be executed on the PI server but not on the FTP server

Couple of checks..

Did you run the script manually on the PI server? Is it working fine?

If it's working fine, then the configuration in PI channel for executing the batch file might be wrong.

Also have a look at the below to debug further

http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/08/17/xi-operation-system-command--erro...

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

Some sample codes - http://www.dostips.com/DtTipsFtpBatchScript.php

Former Member
0 Kudos

Hi Hareesh,

Thanks for the reply. I am new to PI. How to run the script in PI server? How to upload the .bat file into PI server.?

Please let me know.

Thanks,
Satheesh

former_member184720
Active Contributor
0 Kudos

Hi Satheesh -

I don't think you would be having the access run this batch file on the PI Operating System.

Take help from Basis team to upload and run it..

How did you configure the channel without knowing the batch file location ?

P.S. You can upload the file to PI NFS location using sxda_tools transaction but take Basis help as you need to run the batch file too..

Harish
Active Contributor
0 Kudos

Hi Satheesh,

you can upload the batch file to PI (dual stack) All11 folder. please refer the below discussion.

regards,

Harish

Former Member
0 Kudos

Hi Hareesh,

I haven't loaded the .bat in PI server. But I have tried in placing the file in local server and given the path.

Thanks,
Satheesh

former_member184720
Active Contributor
0 Kudos

Hi Sateesh,

The .bat file should be on PI system so place the file and configure the channel accordingly.