Skip to Content

cl_gui_frontend_services=>file_open_dialog: initial_directory ignored...

Hi there,

did anyone experience that the initial_directory will be ignored?

the method firstly will use the initial_directory. But on second move the dialog always shows the last directory the user selected.

It's a nice feature but I would like to control it by myself...!

With this simple report you can check out the behaviour (path D:\temp must exist of course).

Use f4-help for selecting the path. select any other directory and again call f4-search-help.

You will get to the last accessed directory - not to the given directory in the parameters... :/


  DATA filetable TYPE filetable.
  DATA rc        TYPE i.

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
      window_title            = 'Testtitel'
      default_filename        = '*.txt'
      initial_directory       = 'D:\temp\'
      file_filter             = cl_gui_frontend_services=>filetype_all
      file_table              = filetable
      rc                      = rc
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 05, 2017 at 06:39 AM

    Hi Enno,

    my first thought was that this is the expected behaviour like in all other applications. If you are using Notepad and open a second file you always start with the last choosen folder.

    Strange: I've tested your report and I've got a different behaviour: it always starts with d:\temp (on NW740 SP13, GUI 740 Patch 11.1)

    Cheers, Uwe

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Uwe and Rashid for testing this out!

      The problem occurred on an SAP_BASIS731 System. After your comments I also tested it on our 750 System and I again get other results than you do... :/

      The Dialog starts with the last used directory of yesterday...!

      My configuration:

      SAP_BASIS731 & SAP-Logon 7400.3.11.1128

      SAP_BASIS750 & SAP-Logon 7400.3.12.1130

      Uwe: What you describe as "strange behaviour" is exactly the behaviour I need.

      At least I would like to control this:

      1. no initial directory given: use standard directory
      2. no initial directory given: use last accessed directory
      3. initial directory given: Use it

      If I provide an initial directory I expect the dialog to use it...!



  • Jul 05, 2017 at 03:49 PM

    Hello Enno,

    I start on last opened folder like you.

    SAP 731 0019, SapLogon 740 11.06 on Windows 10

    Add comment
    10|10000 characters needed characters exceeded