Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading file to an FTP Server in background

Former Member
0 Kudos

Hi All.

Is it possible to download a file to an FTP server i.e. a network path, in background?

I know in background, we can only use READ DATASET/ OPEN DATASET . But it can only download a file to application server. Can we download to FTP directly?

Thanks in adv.

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor
0 Kudos

Hi,

you could run an external command in the SAP server. The command to download is wget (it's a GPL software that run under M$ and Unix system).

Rgd

Frédéric

4 REPLIES 4

FredericGirod
Active Contributor
0 Kudos

Hi,

you could run an external command in the SAP server. The command to download is wget (it's a GPL software that run under M$ and Unix system).

Rgd

Frédéric

0 Kudos

0 Kudos

sorry... but never done it before..

so could you please elaborate what you are saying?

a sample example would be of great help...

0 Kudos

Hi,

We have done the other way around:

*Connect to the FTP server

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

user = 'ap\s-ftpsgacd'

password = l_v_pwd

host = 'pmipmftpaisdev.eu.pm.com'

rfc_destination = 'SAPFTPA'

IMPORTING

handle = v_handle

EXCEPTIONS

not_connected = 1

OTHERS = 2.

IF sy-subrc <> 0.

ENDIF.

*Get the folders inside the directory

*Execute the FTP Command

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = v_handle

command = fp_l_cmd

TABLES

data = fp_it_result

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

ENDIF.

cheers

Aveek