Skip to Content

cl_gui_frontend_services=>directory_delete

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 28, 2016 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 28, 2016 at 07: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 29, 2016 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.