Open popup window to choose a diretory

Open popup window to choose a diretory

Use method : cl_gui_frontend_services=>directory_browse.

Code example :


  DATA : lv_directory TYPE string.

  " Open the popup window to choose a diretory (without filename !)
  cl_gui_frontend_services=>directory_browse( EXPORTING  window_title    = 'Your title'
                                              CHANGING   selected_folder = lv_directory
                                              EXCEPTIONS cntl_error      = 1
                                                         error_no_gui    = 2 ).

  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno 
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    " OR MESSAGE i001(00) WITH 'Your message'.
    RETURN
  ENDIF.

  cl_gui_cfw=>flush( ).

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV : cv.fjourneau.net.

Leave a Reply