I have a batch file which uploads files to SFTP server using WinSCP. When I run the batch file with command prompt it is working fine!, uploading the file.
But when I try running batch file from SM69 in SAP using parameters below;
Operating System Command: D:\FITRC\Scripts\upload2.bat
Additional Parameters: "D:\FITRC\TEMP\OUT\E-REGISTRY\RETAIL\ABC.ASC" "/OUT/E-REGISTRY/RETAIL/"
The batch file content is:
cd /d E:\FITRC\WinSCP winscp.com /command "option batch abort" "option confirm off" "open sftp:*******com -privatekey=**********.ppk" "cd "%2"" "option transfer binary" "put "%1"" "close" "exit"
I get these;
D:\usr\sap\APD\DVEBMGS00\work>cd /d D:\FITRC\WinSCP D:\FITRC\WinSCP>winscp.com /command "option batch abort" "option confirm off" "open sftp://fit_tr@b2bftpt.apple.com//fit_tr@b2bftpt.apple.com -privatekey= batch abort confirm off Searching for host...
Connecting to host...
Authenticating...
Using username "fit_tr".
Authenticating with public key "".
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] fit_tr@b2bftpt.apple.com /OUT/E-REGISTRY/REtail
transfer binary D:\FITRC\TEMP\OUT\E-REGISTRY\RETAIL\ABC.ASC | 130 KiB | 37.5 KiB/s | binar
Cannot close remote file '
ABC.ASC
'.
General failure (server should provide error description).
Error code: 4
Error message from server: Socket closed already.
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort External program terminated with exit code 1
I also tried the same using RSBDCOS0 report. I get the same errors.
I need help about how I will be able to make this work from SAP.