Application Development and Automation 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: 
Read only

File Transfer

Former Member
0 Likes
864

Hi all,

Any function module or ABAP syntax available to 'Move' a file to a destination directory from it's current location, so that it's permanently removed from the current location. Assume a situation like simple 'Cut-Paste' scenario in windows.

Vishy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

Hi,

I dont think there is any such FM

but you can achieve this in 3 steprs :

1 ) open the source file using open dataset file1. transfer the data into an internal table (itab1)

2 ) open a new file agian with a open dataset file2 statement, this will be your target file and transfer the data from internal table (itab1)

3) delete the source file ( delete dataset file1 )

regards,

Advait

6 REPLIES 6
Read only

Former Member
0 Likes
833

Hi Vishy,

check this link

Regards

Read only

JozsefSzikszai
Active Contributor
0 Likes
833

hi,

acc. to my best knowledge, there is no direct way. However you can do the following:

Use the following methods of class CL_GUI_FRONTEND_SERVICES:

FILE_COPY ==> to copy the file with new name

FILE_DELETE ==> to delete the original file

as result you have only one file with the new name

hope this helps

ec

Read only

Former Member
0 Likes
834

Hi,

I dont think there is any such FM

but you can achieve this in 3 steprs :

1 ) open the source file using open dataset file1. transfer the data into an internal table (itab1)

2 ) open a new file agian with a open dataset file2 statement, this will be your target file and transfer the data from internal table (itab1)

3) delete the source file ( delete dataset file1 )

regards,

Advait

Read only

0 Likes
833

Thanks for all the responses.

Some were very close to the requirement.

But we're using following which is doing exactly what we wanted:

CONCATENATE 'mv' p_fname v_directory INTO v_bkfile

SEPARATED BY SPACE.

CALL FUNCTION 'RFC_REMOTE_EXEC' DESTINATION

'BATCH_INBOUND'

EXPORTING

COMMAND = v_bkfile.

Here, mv - is a shell script command for 'Move'

p_fname - name of the file

v_directory - path of the destination directory.

vishy

Read only

0 Likes
833

hi,

I have same requirment . i used same as u but it is not working .

so please help me regarding this.

Regards,

T.Srinvas

Read only

Former Member
0 Likes
833

Hi, i dont think there is some function module which performs in one step.

But you can try workarounds.

you can try this two methods:

1) Use function module to upload from first location and copy to other location by using download fm.

But it will not delete the base file.

2) A method you can use is create a dos batch command to do the job.

Execute the batch command from sap. Function Module GUI_EXECUTE or WS_EXECUTE. if its on presentation layer.