Skip to Content
Former Member
Nov 25, 2011 at 01:25 PM

Open window code in Component controller



My requirement is to show the pop up window for search help which is reuseble for all view.for that i have created one method in component controller which can be used by all view.

I have created one window "TEST_WINDOW" and embedded a view name as "TEST_VIEW".

By following code window is opened properly but after adding subscribe_to_button_event method i m facing null pointer error.

  DATA lo_window_manager TYPE REF TO if_wd_window_manager.
  DATA lo_api_component  TYPE REF TO if_wd_component.
  DATA lo_window       TYPE REF TO if_wd_window.
  DATA l_api type ref to if_wd_view_controller.

  lo_api_component  = wd_this->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window   = lo_window_manager->create_window(
                     window_name            = "TEST_WINDOW"
                     message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                     button_kind            = if_wd_window=>co_buttons_ok
                     message_type           = if_wd_window=>co_msg_type_none
                     default_button         = if_wd_window=>co_button_ok

 lo_window->open( ).


I have added following code.Code for "ok" button action .Code created 'a_selected_material' action is properly created in TEST_VIEW view but null pointer is getting in this line lo_window->subscribe_to_button_event(

               button            = if_wd_window=>co_button_ok
               action_name       = 'a_selected_material'
               action_view       = l_api
               is_default_button = abap_false ).

Please help me out for this issues.

Thanks & ragards

Abhilasha Dahare.