Skip to Content
-2

Open a windows folder by ABAP in ALV

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.

Add comment
10|10000 characters needed 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.

  • Get RSS Feed

5 Answers

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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2017 at 07:19 AM
    Add comment
    10|10000 characters needed characters exceeded

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

    Add comment
    10|10000 characters needed 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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2017 at 09:40 AM

    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

    Add comment
    10|10000 characters needed characters exceeded