Hello all,
I am trying to add a button to standard FPM button dynamically.
In an implementation of WD_BADI_DOMODIFYVIEW I have written following code as below -
DATA : lo_toolbar TYPE REF TO cl_wd_toolbar,
lo_toolbar_button TYPE REF TO cl_wd_toolbar_button,
lo_tool_item TYPE REF TO if_wd_toolbar_item.
IF ir_view_info->get_name( ) EQ 'CNR_VIEW'.
lo_toolbar ?= ir_view->get_element( 'TOOLBAR' ).
CALL METHOD cl_wd_toolbar_button=>new_toolbar_button
EXPORTING
enabled = 'X'
id = 'CUST_BUTT'
on_action = 'DOACT'
text = 'Custom Button'
view = ir_view
visible = '02'
RECEIVING
control = lo_toolbar_button.
lo_tool_item ?= lo_toolbar_button.
CALL METHOD lo_toolbar->add_toolbar_item
EXPORTING
index = 7
the_toolbar_item = lo_tool_item.
ENDIF.
In this case, no error is occurring and in ir_view->toolbar attribute toolbar items, i can see the dynamically created button added to the list, but it is not getting displayed.
Can anyone tell what or where am I missing?
Regards,
Yayati