cancel
Showing results for 
Search instead for 
Did you mean: 

ALV-Image and button name should be changed after ckicking on button...

Former Member
0 Kudos

Hi,

I Have buttons in one column..After clicking on update button, it should be changed to Updated and image should be changed to green color.nd it should effect to only one particular row..

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi, on action of button write one method in that

use class cl_wd_button . and method as set_text() to change name of button.

thanks

kanchan

Former Member
0 Kudos

Hi Vasavi,

Try llike this..to change button text.

data:
lr_button type ref to CL_SALV_WD_FE_BUTTON,
lr_function type ref to cl_salv_wd_function.

lr_function = l_alv_model->if_salv_wd_function_settings~get_function( ID = <your ID> ).
lr_button ?= lr_function->get_editor( ).
lr_button->set_text( ).

To change color... check this..

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71...

Cheers,

Kris.

krishnendu_laha
Active Contributor
0 Kudos

For changing button text, I would suggest to declare an extra field in internal table (hidden) which will hold text in runtime..

and when you are using code for button add below code also:

CL_SALV_WD_UIE_A_BUTTON->SET_TEXT_FIELDNAME ( 'hidden field')

You can do same thing with image, declare another field which will hold image url:

CL_SALV_WD_UIE_IMAGE -> SET_SOURCE_FIELDNAME ( 'another hidden field' )

Now after clicking the button, simply assign different text name and source imgae; it will be displayed with immediate effect and only for one row...

Note:

Please use object reference instead of class name and field name should be in Caps.

Thanks

Former Member
0 Kudos

HI,

I have given code like this in update button action..such that it is changing entire column button as updated..not for single row entire column changing..can u give me suggestion to resoilve this?

DATA: lr_button TYPE REF TO cl_salv_wd_uie_button.

lr_column = l_value->if_salv_wd_column_settings~get_column( 'UPDATE').

CREATE OBJECT lr_button.

DATA lr_buttonui TYPE REF TO cl_salv_wd_fe_button.

CREATE OBJECT lr_buttonui.

lr_button->set_text( 'Updated' ).

lr_column->set_cell_editor( lr_button ).

Former Member
0 Kudos

Hi Vasavi,

Try this..

  • create an instance of ALV component

DATA:
    lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
* get ALV component
  DATA:
    lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
  DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lr_column type ref to CL_SALV_WD_COLUMN,
        lr_column_hdr type ref to CL_SALV_WD_COLUMN_HEADER,
        lr_button_1 TYPE REF TO cl_salv_wd_uie_button.
 
  lr_salv_wd_table_usage = wd_this->wd_cpuse_<Alv component usage name>( ).
  IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
    lr_salv_wd_table_usage->create_component( ).
  ENDIF.
 
  lr_salv_wd_table = wd_this->wd_cpifc_<Alv component usage name>( ).
  wd_this->alv_table = lr_salv_wd_table->get_model( ).
 
 lr_column_settings ?= wd_this->alv_table.
lr_column = lr_column_settings->get_column( 'UPDATE' ).
CREATE OBJECT lr_button_1.
  lr_button_1->set_text( 'UPDATED' ).
  lr_column->set_cell_editor( lr_button_1).

Cheers,

Kris.