cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy files from one directory to another on application server?

Former Member
0 Kudos

Hi,

I have some files on application server i.e. /usr/abc/xyz/1.txt

/usr/abc/xyz/2.txt etc.

Now I need to copy these files in different directory with different names i.e./usr/abc/xyz_copy/1_copy.txt

/usr/abc/xyz_copy/2_copy.txt

How can i do that in function module in ABAP instead of open dataset?

Can anybody tell me how to use unix command like cp(for COPY) in ABAP?

Thanks and regards,

Deepak

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check this FM

DATA: BEGIN OF i_tabl OCCURS 0,

f1(132) TYPE c,

END OF i_tabl.

DATA: command(132) TYPE c,

command2(132) TYPE c.

CONCATENATE 'rm' i_param-unix_path INTO command SEPARATED BY space.

CONCATENATE command i_param-file_name INTO command2.

CALL FUNCTION 'RFC_REMOTE_PIPE' DESTINATION 'SERVER_EXEC'

EXPORTING command = command

read = 'X'

TABLES pipedata = i_tabl.

Here 'SERVER_EXEC' is the TCP/IP connection created in SM59.

Command is the Unix command

i_tab1 is for any error messages.

Hope this helps.

Thanks,

Sarika.