06-28-2016 8:21 AM
Hi experts,
I am using this class to delete a directory on the local client pc. I have access to read/write in the folder and I am prompted if I want to give SAP GUI access to delete the directory. When I click yes, I get the exception 'Unknown Error'.
Any ideas?
Thanks,
Martin
06-28-2016 2:05 PM
Hi Martin,
The following sample code should work. Please let me know in case of any issues.
DATA: oref TYPE REF TO cl_gui_frontend_services.
DATA: directory TYPE string, retcode TYPE i.
START-OF-SELECTION.
CREATE OBJECT oref.
oref->directory_browse( CHANGING selected_folder = directory ).
oref->directory_delete( EXPORTING directory = directory
CHANGING rc = retcode ).
Thanks
RM
06-28-2016 2:05 PM
Hi Martin,
The following sample code should work. Please let me know in case of any issues.
DATA: oref TYPE REF TO cl_gui_frontend_services.
DATA: directory TYPE string, retcode TYPE i.
START-OF-SELECTION.
CREATE OBJECT oref.
oref->directory_browse( CHANGING selected_folder = directory ).
oref->directory_delete( EXPORTING directory = directory
CHANGING rc = retcode ).
Thanks
RM
06-28-2016 8:44 PM
Not authorized? Try with other directories. I have the same kind of issue, and I came to the conclusion that some directories have different Windows owners. I can access them from Windows, but not from the SAP GUI. I also had the surprise that the same directory can be accessed using 2 paths (as we can see in Windows), and only one of them can be accessed from the SAP GUI. Moreover, if you use Citrix or softwares like that, it may be different.
06-29-2016 7:07 AM
I found out, that the issue is due to the folder not being empty. I have deleted the files in the folder before folder deletion, and then it works just fine.
Thanks,
Martin