Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: get ALV list instantly

$
0
0

Hi,

 

 

You can also use the toolbar event of CL_GUI_ALV_GRID .

 

 

Get the book An Easy Reference for ALV Grid Control

 

 

Sample Code:

 

 

In a class :

 

 

METHODS: toolbar

             FOR EVENT toolbar OF cl_gui_alv_grid

             IMPORTING e_object e_interactive .

           

*----------------------------------------------------------------------*

METHOD toolbar.

 

    DATA: button TYPE stb_button.

 

    FIELD-SYMBOLS: <st_toolbar> LIKE LINE OF e_object->mt_toolbar .

 

    LOOP AT e_object->mt_toolbar ASSIGNING <st_toolbar> .

 

* Kill al the table tools(e.g.  add,copy etc.)

      IF <st_toolbar>-function CS 'LOCAL' .

        <st_toolbar>-disabled = abap_true .

        DELETE e_object->mt_toolbar .

        CONTINUE .

      ENDIF .

 

      CASE <st_toolbar>-function .

        WHEN cl_gui_alv_grid=>mc_fc_sort_asc OR

             cl_gui_alv_grid=>mc_fc_sort_dsc .

          <st_toolbar>-disabled = abap_true .

        WHEN cl_gui_alv_grid=>mc_mb_export .

*         <st_toolbar>-disabled = abap_true .

        WHEN cl_gui_alv_grid=>mc_fc_send  .

          <st_toolbar>-disabled = abap_true .

      ENDCASE .

 

    ENDLOOP.

 

    CLEAR button.

    button-butn_type = cntb_btype_sep .

    APPEND button TO e_object->mt_toolbar.

 

    CLEAR button.

    button-function = gc_save_ex .

    button-icon = icon_write_file .

    button-text = gc_save_ex .

    APPEND button TO e_object->mt_toolbar.

 

  ENDMETHOD.                    "handle_toolbar

*-----------------------------------------------------------    

     

 

 

Also See here CL_GUI_ALV_GRID in "List output" mode

 

 

Regards.


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>