cancel
Showing results for 
Search instead for 
Did you mean: 

create change/edit button in ALV

Former Member
0 Kudos

Hello Experts,

How to insert the button in ALV grid toolbar. Now its showing Check,insert,append and delete button.How to add change or edit button in ALV ?

I'm using ALV componenet SALV_WD_TABLE.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

With the previous reply you can create the customized button.

to make ALV editable or non editable(change or read only) the code to be written is:

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  DATA lo_value TYPE REF TO cl_salv_wd_config_table.

  lo_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
  lo_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
  lo_value = lo_interfacecontroller->get_model( ).


 *lr_table_settings->set_read_only( abap_false ).*"you can  make it abap_true or abap_false based  to make

the ALV editable or non editable

Priya

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Use this code to add new button:

  • Custom PDF Button in ALV Toolbar.

DATA: lr_function TYPE REF TO cl_salv_wd_function,
        lr_toggle_button TYPE REF TO cl_salv_wd_fe_button.

  lr_function = l_value->if_salv_wd_function_settings~create_function(
  id = 'F' ).

  CREATE OBJECT lr_toggle_button.
  lr_toggle_button->set_text( 'View PDF Form' ).
  lr_function->set_editor( value = lr_toggle_button  ).

refer this link : http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110

Edited by: Saurav Mago on Dec 17, 2009 6:12 PM

Former Member
0 Kudos

HI Saurav Mago,

Thanks for reply. How to get a pre-defined delete button action in alv? Please suggest me.

Thanks.

Former Member
0 Kudos

Use this code :

l_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_true ).

Former Member
0 Kudos

HI,

I have also the same issue ....I have set the button already but now I want to capture delete/standard ALV button action. I want to do some process when delete button clicks. My question is how to capture the delete button action in ALV?

Thanks.