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: 

Moving Files in FTP Server

Former Member
0 Kudos

Dear Experts,

In an FTP SERVER ,I have a file say x.txt located under the folder "Incoming".

I want to move this file from the "Incoming" directory to "Test" directory.

"Incoming" and "Test" directory are on the same level.

Is there a command to do it with "FTP_command" in ABAP

Thanks

K

5 REPLIES 5

Former Member
0 Kudos

Hi Fathima,

Did you search the forum? This has been discussed a couple of times.

http://scn.sap.com/thread/1773085

Regards,

Shravan

Former Member
0 Kudos

Hi,

I have the same issue. Did you find an answer for this?

Thanks in advance.

Regards,

Sónia Gonçalves

former_member282823
Active Participant
0 Kudos

Hi,

  Just check the prog RSFTP004 for FTP copy and also check progs

RSFTP002

RSFTP003

RSFTP005

RSFTP006

RSFTP007

RSFTP008

RSFTP009

RSFTP011

Regards,

Ramesh.

0 Kudos

Hi,

Thanks for your reply.

But I would like to know if there's another FTP command to do this, either than copy and delete.

I read that command "RENAME" could probably do this. Is that right?

Thanks.

Best regards,

Sónia Gonçalves

former_member203305
Active Contributor
0 Kudos

Hello.

Yes, u can move the files to another directory. The way to do it is using RENAME command.

I have done this, have a look this code

"l_fname2 contains the file name.

  CONCATENATE 'TEST/' l_fname2 INTO l_string_error.  " New directory

  CONCATENATE 'rename' l_fname2 l_string_error INTO l_command SEPARATED BY space.

  CALL FUNCTION 'FTP_COMMAND'

    EXPORTING

      handle        = mi_handle

      command       = l_command

    TABLES

      data          = mtab_data

    EXCEPTIONS

      tcpip_error   = 1

      command_error = 2

      data_error    = 3

      OTHERS        = 4.

Regards