‎2008 Nov 06 9:23 PM
Hi all,
After I have finished the processing of an excel file(uploading it into an itab and copied this file from one folder to another folder), I want to delete this file.
However I can not delete it, it is said it is being used...
How can I control whether it is being used or not? And if not used then I can delete, how can I understand that?
Thanks.
deniz.
‎2008 Nov 06 9:50 PM
‎2008 Nov 06 9:53 PM
if the file is in application server after close dataset to read the file you can use delete dataset statement to delete the file from app server.
CONVT_DELETE_FILES
GUI_DELETE_FILE fm might help u..
‎2008 Nov 07 8:31 AM
Hi,
The file is under a directory at My Computer, not on application server and I do not use dataset.
Just got the file and upload it through:
ALSM_EXCEL_TO_INTERNAL_TABLE.
Actually I get a list of files under directory and loop through this file itab and upload all files into data itab.
After uploading the file into itab, and do some more works,
I want to delete this file but could not achieve this.
Thanks.
deniz.
‎2008 Nov 07 8:33 AM
Hello,
To upload file you will select path take that select path in one variable and pass that variable to the FM below.
data: y_lv_dpath TYPE rlgrap-filename.
CALL FUNCTION 'GUI_DELETE_FILE'
EXPORTING
file_name = y_lv_dpath
EXCEPTIONS
failed = 0
OTHERS = 0.
‎2008 Nov 07 8:34 AM
If the file is in your Presentation server then you can go to that path and delete the file. If it is giving you a error message that it is being used by some other program then try to end all the programs that you are running and then try it again.
Thanks,
Jayant
‎2008 Nov 07 8:48 AM
Hi Jayant,
Thanks.
You understood the problem but actual problem is that the program that uses file and wants to delete the file is the same program.
Logic is that, get data of a file and then delete this file with the same program.
There is one way to solve this problem and it is to know when SHARING_VIOLATION ends.
Thanks.
deniz.
‎2008 Nov 07 8:40 AM
Hi try like this.
open dataset.
--
--
-
-
close data set
delete dataset.
Kiran