Skip to Content
-2

Open a windows folder by ABAP in ALV

May 17, 2017 at 04:08 AM

189

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.

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

5 Answers

Richard Harper May 17, 2017 at 06:48 AM
1

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.

0

File_Open_Dialog.

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

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

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

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

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

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

Hello,

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
                               e_column
                               es_row_no.

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.
     WHEN 'FOLDER'.
        <fieldcatalog>-hotspot = 'X'.
  ENDCASE.
ENDLOOP.
my_grid->set_frontend_fieldcatalog( t_fieldcatalog ).
my_grid->refresh_table_display( ).
cl_gui_cfw=>flush( ).

Best regards

Bertrand

Share
10 |10000 characters needed characters left characters exceeded