Hi Madan,
Sample code:
method if_bsp_wd_history_state_descr~get_state_description.
data: lr_comp_controller type ref to cl_bt111s_o_bspwdcomponen_impl.
- here the name of the button and the event is determine
lr_comp_controller ?= comp_controller.
if lr_comp_controller->gv_archive = abap_false.
description = cl_wd_utilities=>get_otr_text_by_alias( 'ZCRM/SEARCH_OPPORTUNITY' ).
else.
description = text-003.
endif.
endmethod.