‎2008 Mar 13 4:27 PM
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
‎2008 Mar 13 4:48 PM
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
‎2008 Mar 13 4:31 PM
‎2008 Mar 13 4:36 PM
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
‎2008 Mar 13 4:48 PM
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
‎2008 Mar 14 12:24 PM
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
‎2009 May 22 9:53 AM
hi,
I have same requirment . i used same as u but it is not working .
so please help me regarding this.
Regards,
T.Srinvas
‎2009 May 22 10:07 AM
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.