Skip to Content
0

cl_gui_frontend_services=>file_open_dialog: initial_directory ignored...

Jul 04, 2017 at 02:51 PM

272

avatar image

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... :/

PARAMETERS p_file TYPE c LENGTH 200.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  DATA filetable TYPE filetable.
  DATA rc        TYPE i.


  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = 'Testtitel'
      default_filename        = '*.txt'
      initial_directory       = 'D:\temp\'
      file_filter             = cl_gui_frontend_services=>filetype_all
    CHANGING
      file_table              = filetable
      rc                      = rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Uwe Fetzer Jul 05, 2017 at 06:39 AM
1

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Uwe

I second that. I tested it on NW740 SP10 GUI 740 Patch 4(on Windows 7) and got the same result as you mentioned. It always starts with d:\temp (or whatever directory mentioned in initial_directory parameter).

@Enno: what version of NW and Gui you are using ?

0

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...!

Regards

~Enno

0
Bertrand DELVALLEE Jul 05, 2017 at 03:49 PM
1

Hello Enno,

I start on last opened folder like you.

SAP 731 0019, SapLogon 740 11.06 on Windows 10

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Bertrand for checking and your confirmation!

0