Hi,
Use SUBSCRIBE_TO_BUTTON_EVENT method of window before opening window.
Use Create_window method.
Code Snippet:
DATA lr_window_manager TYPE REF TO if_wd_window_manager.
DATA lr_api_component TYPE REF TO if_wd_component.
DATA lr_window TYPE REF TO if_wd_window.
data lr_view_controller TYPE REF TO if_wd_view_controller.
lr_api_component = wd_comp_controller->wd_get_api( ).
lr_window_manager = lr_api_component->get_window_manager( ).
lr_window = lr_window_manager->create_window(
window_name = 'INVOICES_WIN'
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
).
lr_view_controller = wd_this->wd_get_api( ).
CALL METHOD lo_window->subscribe_to_button_event " register event before opening window
EXPORTING
button = if_wd_window=>co_button_ok
action_name = 'OK' " You have to create action OK in Actions tab & write req handling
action_view = lr_view_controller.
lo_window->open( ).
Hope this helps u,
Regards,
Kiran