Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Open window code in Component controller

Hello,

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(


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.

Former Member
Not what you were looking for? View more on this topic or Ask a question