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: 

Question about FTP

yonatanedgardo_diaz
Participant
0 Kudos

Can take multiple files from an FTP directory with the functions:

CALL FUNCTION 'FTP_CONNECT' and CALL FUNCTION 'FTP_COMMAND'.

Or Can take only file?

What is the function to move a file from an FTP directory to another?

Thanks

1 ACCEPTED SOLUTION

mvoros
Active Contributor
0 Kudos

Hi,

you can call FTP_COMMAND multiple times hence yes, you can copy multiple files. You can try command rename for moving files.

Cheers

3 REPLIES 3

mvoros
Active Contributor
0 Kudos

Hi,

you can call FTP_COMMAND multiple times hence yes, you can copy multiple files. You can try command rename for moving files.

Cheers

former_member183990
Active Contributor
0 Kudos

hi

it depends upon the command you are passing.

there are commands like

get

get*

if you use get* command then i think in a single go you can copy all the files for the given location

cheers

s.janagar

yonatanedgardo_diaz
Participant
0 Kudos

I solved this form.

  • Encryptación de Password

CALL FUNCTION 'HTTP_SCRAMBLE'

EXPORTING

SOURCE = L_PASSWORD

SOURCELEN = L_LEN

KEY = DC_KEY

IMPORTING

DESTINATION = L_PASSWORD.

  • Función para Conectarse al Servidor FTP

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

USER = L_USUARIO

PASSWORD = L_PASSWORD

HOST = L_HOST

RFC_DESTINATION = L_DESTINATION

IMPORTING

HANDLE = D_HANDLE

EXCEPTIONS

NOT_CONNECTED = 1

OTHERS = 2.

  • USE COMMAND cd

  • USE COMMAND ls

  • Funcion de Commandos para Conexiones FTP

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = D_HANDLE

command = D_CMD

TABLES

data = I_RESULT

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

  • FUNCION PARA RECUPERAR ARCHIVOS DESDE EL SERVIDOR

CALL FUNCTION 'FTP_SERVER_TO_R3'

EXPORTING

HANDLE = D_HANDLE

FNAME = D_CMD

CHARACTER_MODE = DC_X

TABLES

TEXT = I_FTP

EXCEPTIONS

TCPIP_ERROR = 1

COMMAND_ERROR = 2

DATA_ERROR = 3

OTHERS = 4.

  • Funcion para Enviar los Archivos al Servidor FTP

CALL FUNCTION 'FTP_R3_TO_SERVER'

EXPORTING

HANDLE = D_HANDLE

FNAME = D_CMD

BLOB_LENGTH = L_LENGTH

CHARACTER_MODE = DC_X

TABLES

TEXT = I_LOG_AUX

EXCEPTIONS

TCPIP_ERROR = 1

COMMAND_ERROR = 2

DATA_ERROR = 3

OTHERS = 4.

  • Función para Desconectarse del Servidor FTP

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

HANDLE = D_HANDLE

EXCEPTIONS

OTHERS = 1.