Quantcast
Viewing latest article 8
Browse Latest Browse All 9

Re: Toolbar buttons - view directly assigned to window

Hi,

 

If you are using Window Controller IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS

1.> Add a code to add button.

 

DATA: wa_button TYPE crmt_thtmlb_button_ext,
         lit_buttons TYPE crmt_thtmlb_button_ext_t.

 

    wa_button-id = 'Save'.
   wa_button-text = 'Save'.
   wa_button-type = cl_thtmlb_util=>gc_icon_save.
   wa_button-on_click = 'SAVE'.
   wa_button-enabled = lr_cuco->gv_save_enabled.
   wa_button-page_id = me->component_id.
   APPEND wa_button TO lit_buttons.


2.> Redefine Do_Handle_event of Window Impl Class.

Add the Below Code.

when 'SAVE'.
       eh_onsave( htmlb_event = htmlb_event
                  htmlb_event_ex = htmlb_event_ex ).

 

 

3.> Create a method EH_ONSAVE in window Impl class.

Add Below Code.

 

method eh_onsave.
   data: lr_cuco type ref to zl_Customcontollclass_impl.
   lr_cuco ?= me->get_custom_controller( 'Name of Custom Controller class').
   check lr_cuco is bound.
   lr_cuco->save( ).
endmethod.

 

4.> Create a Save method in Custom Controller Impl class and add your own logic.

 

Regards,

Sumeet


Viewing latest article 8
Browse Latest Browse All 9

Trending Articles