Skip to Content
avatar image
Former Member

Adding custom button in standard toolbar in ALV

Hello All,

I need to add a customized button called "Copy" on ALV. The following code is giving me few standard buttons like "Append" "Delete" "Insert" etc. So, how can I add "Copy" button besides one of these standard buttons.

data: l_value type ref to cl_salv_wd_config_table.

data: lr_table_settings type ref to if_salv_wd_table_settings.

lr_table_settings ?= l_value.

lr_table_settings->set_read_only( abap_false ).

Appreciate help.

Thks & Rgds,

Hemal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 14, 2010 at 04:47 AM

    Hi Hemal,

    Refer to the below link which has step by step example to create new buttons and place them in alv toolbar.

    [Add new custom buttons in ALV toolbar - http://divulgesap.com/blog.php?p=NzI= |http://divulgesap.com/blog.php?p=NzI=]

    Hope it helps.

    Cheers,

    Ravikiran

    Edited by: Thomas Jung on Apr 14, 2010 8:32 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2010 at 04:16 AM

    Hi Hemal,

    Check the following thread:

    alv-webdynpro

    It has the code to create a toolbar button in ALV and how to handle the button action.

    Regards

    Manas Dua

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 28, 2010 at 08:18 PM

    Create One method

    And inside that method write the below code

    (Here i am creating delete button you can create any name button you want just replace the name

    DATA lV_EDITBTN TYPE REF TO cl_salv_wd_fe_button.

    DATA lr_buttonui TYPE REF TO cl_salv_wd_fe_button.

    CREATE OBJECT lr_buttonui.

    lr_buttonui->set_text( 'Details' ).

    lr_buttonui->set_tooltip(

    'Shows Detail Screen as per the View selected' ).

    • Generating Function Object for Button.*

    DATA btn_button TYPE REF TO cl_salv_wd_function.

    btn_button = lo_value->if_salv_wd_function_settings~create_function(

    id = 'DETAILS' ).

    btn_button->set_editor( lr_buttonui ).

    DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.

    ----


    After that create another method and make it as a event ( it means now it become event )

    select event ON FUNCTION FROM THE LIST

    Inside that event write

    CASE LV_FCODE.

    WHEN 'DETAILS'.

    wd_this->fire_OP_TODEATILS_plg( ).

    endcase.

    ----


    May be it may help

    Add comment
    10|10000 characters needed characters exceeded