Skip to Content

Open a windows folder by ABAP in ALV

May 17, 2017 at 04:08 AM


avatar image
Former Member

Hi Experts,

I have a requirement to open a specific file folder by clicking a link in ALV grid.

As a Example, when I click a cell in the ALV grid, It should open a folder that I have given like, "C:\Users\anuradhawi\Documents" .

Is there anyway to do this.

10 |10000 characters needed characters left characters exceeded

Is the question about how to code the click on ALV grid? (and then, please tell us which technology do you use?)

Or only about how to open a dialog to display the files within a folder? (from the user's desktop)

You'd probably get many many answers by searching, too.

* Please Login or Register to Answer, Follow or Comment.

5 Answers

Richard Harper May 17, 2017 at 06:48 AM

It's easy enough. A combination of handling a double click event and one of th methods from CL_GUI_FRONTEND_SERVICES. Thats enough to get you started and a little more than what was said above.

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

Hi Rechard, There is no method to Open Windows Forlder in the class. but there are some other methods.



I'm certain that allows you to open a windows folder...........

Horst Keller
Jul 05, 2017 at 07:19 AM
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
May 17, 2017 at 06:24 AM

Look at ZAL11 : a replacement for AL11, this tool can display folders from application and presentation server, and much more options.

10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 17, 2017 at 06:37 AM

There is also report e.g. RSPO0020 which displays spool directory with functionality to download files from the folder.

10 |10000 characters needed characters left characters exceeded
Bertrand DELVALLEE Jul 05, 2017 at 09:40 AM


To handle your click event it depends on what method you use to display your ALV grid (REUSE FM or ALV class).

For example, with ALV class I define a method like this ( in my controler local class dealing with my_grid) :

doubleclick_handle FOR EVENT double_click OF cl_gui_alv_grid
                     IMPORTING e_row

In the constructor method of this controler I set the handler :

 SET HANDLER doubleclick_handle FOR my_grid. " DATA my_grid TYPE REF TO cl_gui_alv_grid

In the implementation of the handler method you can use this call to display the content of a local folder:

DATA w_folder TYPE string VALUE `C:\temp\`.
cl_gui_frontend_services=>directory_browse( CHANGING selected_folder = w_folder ).

I recommend you to use a HOTSPOT link in the same way. All you have to do more is to change the fieldcatalog to underline the value :

DATA t_fieldcatalog TYPE lvc_t_fcat.
FIELD-SYMBOLS <fieldcatalog>  TYPE LINE OF lvc_t_fcat.
my_grid->get_frontend_fieldcatalog( IMPORTING et_fieldcatalog = t_fieldcatalog ).
LOOP AT t_fieldcatalog ASSIGNING <fieldcatalog>.
  <fieldcatalog>-col_opt = 'X'.
  CASE <fieldcatalog>-fieldname.
        <fieldcatalog>-hotspot = 'X'.
my_grid->set_frontend_fieldcatalog( t_fieldcatalog ).
my_grid->refresh_table_display( ).
cl_gui_cfw=>flush( ).

Best regards


10 |10000 characters needed characters left characters exceeded