Quantcast
Channel: SCN : Unanswered Discussions - ABAP Development
Viewing all articles
Browse latest Browse all 8768

Upload file to SFTP server via SAP

$
0
0

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.


Viewing all articles
Browse latest Browse all 8768

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>