Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FILE_OPEN_DIALOG problem

Former Member
0 Kudos
261

Hi,

I am using CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to open a directory in Network. (I dont want to open or select any files just to open the directory and see documents are there or not)

example:

Network directory is: \\network\directory

Folders in the directory are: folder1, folder2.

now my code is like below:

        lv_folder = '\\network\directory\folder1'.

        CALL METHOD cl_gui_frontend_services=>file_open_dialog

          EXPORTING

            initial_directory = lv_folder

          CHANGING

            file_table         = lt_file

            rc                   = lv_rc.

This works fine.

Now if i am giving folder3 which is not existing in the directory. 

        lv_folder = '\\network\directory\folder3'.

        CALL METHOD cl_gui_frontend_services=>file_open_dialog

          EXPORTING

            initial_directory = lv_folder

          CHANGING

            file_table         = lt_file

            rc                   = lv_rc.

after execution, i am seeing the last folder location '\\network\directory\folder1'  instead of \\network\directory. Also other thing i observed is, if i open any other report which is using the same method it points to same old location '\\network\directory\folder1' .

This method is more suitable with my requirement(look and feel similar to our regular windows file opening) than other method: directory_browse.

Could you pls help where i am doing wrong.

Regards,

Sree

1 REPLY 1

Former Member
0 Kudos
70

hello,

If the folder does not exist then the method will try to open a previously opened directory. You can check the code for the method, you will find the code for the same.

You could also check method DIRECTORY_BROWSE if you are only browsing directories. There are more of them which can be used to verify if directory exists

DIRECTORY_BROWSE

DIRECTORY_CREATE

DIRECTORY_DELETE

DIRECTORY_EXIST

best regards,

swanand