Skip to Content
Nov 08, 2011 at 03:03 PM

Popup and buttons?



I am successfully throwing a popup to the user (my_popup has YES, NO and CANCEL buttons), with the below code, but, i want to subscribe some actions to these 3 buttons, so i got the SAP help link


* Navigate from <CONTEXT> to <ERROR_MESSAGE> via lead selection
        lo_nd_popup_table = wd_context->get_child_node( name = wd_this->wdctx_my_table ).
* Get element via lead selection
        lo_el_popup_table = lo_nd_popup_table->get_element( ).
* Set table attribute
        lo_nd_popup_table->bind_table( new_items = it_my_itab_table ).
        lo_api_component = wd_comp_controller->wd_get_api( ).
        lo_window_manager = lo_api_component->get_window_manager( ).
        lo_window = lo_window_manager->create_window(
        window_name = 'POPUP1'
        title = 'Below lines are ifirst category tems!'
        message_display_mode = if_wd_window=>co_msg_display_mode_selected
        close_button = abap_true
        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( ).
* Close the window
        lo_window->close( ).

from the link, pls. let me know but, i do not understand,

1) Where i should put my code for each action? do i need to go to directly to METHODS tab of the view and i hv to append a new method on the list and putting my code there? for example. my_action_yes_method? if so, is it a event handler (or) a method, or Supply function which i shuld select from the drop-down?

2) Seems its asking to put my code in WDDOINIT method, but, how can differentiate my piece of code depending on pressed button/action, in normal prog. i will write like below,

IF user_action = 'YES'.
my code here.

IF user_action = 'NO'.
my code here.