2008 Nov 26 2:56 PM
Hi all ,
I m using a method cl_gui_frontend_services=>file_open_dialog , but when i want to renam the folder containing the selected file it show a window error (cannot rename foldername : it is being used by another person or program...) , even i exit the SAP.
thanks ,
karim
2008 Nov 26 2:59 PM
No matters you exit ..may be some else using this in change mode,
Check entries from SM12.
2008 Nov 26 3:17 PM
nothing in SM12 .
I try to rename the folder manualy in my hard disk ,
example
if i open the file C:\new folder 1\ test.txt , when i want to rename new folder , i had the error
i have the code below
report test .
Parameters : AUSZFILE LIKE RFPDO1-FEBUMSF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR AUSZFILE.
DATA: L_FILES TYPE FILETABLE,
H_FILES TYPE FILE_TABLE,
L_RC LIKE SY-SUBRC.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
* EXPORTING
* window_title =
* default_extension =
* default_filename =
* file_filter =
* with_encoding =
* initial_directory =
* multiselection =
CHANGING
file_table = L_FILES
rc = L_RC
* user_action =
* file_encoding =
* EXCEPTIONS
* file_open_dialog_failed = 1
* cntl_error = 2
* error_no_gui = 3
* not_supported_by_gui = 4
* others = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
***********
thanks .
2008 Nov 26 3:24 PM
First you must check whether file is exsist or not?
from these below methods:
CALL METHOD cl_gui_frontend_services=>FILE_EXIST
Than get file attributes:
CALL METHOD cl_gui_frontend_services=>FILE_GET_ATTRIBUTES
Than change name from method FILE_SET_ATTRIBUTES.
And if you are make sure of existance than you can change file name in one step
like
CALL METHOD cl_gui_frontend_services=>file_copy
EXPORTING
SOURCE = l_newdoc_file"Old file name
DESTINATION = l_layout_file"New file name:give here same destinatation of old file name but name shoud be different,so it will rename it.
overwrite = true
2008 Nov 26 3:37 PM
Hi Amit.
i want just to be able to change the name of the folder manualy by 2 click when i finish the execution of my program nothing less nothing more .
thanks
karim
2008 Nov 26 3:51 PM
Why not you are using CALL METHOD cl_gui_frontend_services=>file_copy?As same way i suggested in my above reply.it will change programatically once you pass source and destination file path.
And for manually change from SAP by 2 click i'm not sure.
2008 Nov 26 4:10 PM
its possible that im not explain clearly my requirement , when i select i file using
file_open_dialog example c:\folder1\file.txt , and i finish the execution of the program , i try
to rename the folder "folder1" ,then i go to the hard disk C: and when i try to rename it manualy i had the error