cancel
Showing results for 
Search instead for 
Did you mean: 

Putting action in standard OK button in popup

Former Member
0 Kudos

Hi all,

I have a requirement where i have a button on clicking which a popup will open. Now i want to write an action method in the OK button of the popup. This OK button is the standard one that comes automatically for the popup.How and where can i write the method. Please help..

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Abhishek,

Here are the steps:

1. Create and call the window manager

l_api_main = wd_this->wd_get_api( ).

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

l_popup = l_window_manager->create_popup_to_confirm(

text = lt_texts

button_kind = if_wd_window=>co_buttons_yesno

message_type = '5'

window_title = 'Confirm Delete Group' ).

  • For OK button

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

action_name = 'OK'

action_view = l_api_main

is_default_button = abap_true ).

  • Same for Cancel button

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_no

action_name = 'CANCEL'

action_view = l_api_main

is_default_button = abap_false ).

2. Call the window

l_popup->open( ).

3. Write the action handler

Create two actions OK and CANCEL in the Actions tab.

Write the necessary code for each of them.

Hope this was helpful.

Regards,

Arpan

Former Member
0 Kudos

Hi,

when you write the code to call the popup, subscribe to the event for ok button as follows,

lo_window->subscribe_to_button_event(
               button            = if_wd_window=>co_button_ok
               action_name       = 'OK' " goto actions tab and create an action with the same name and place the required code 
               action_view       = l_api
               is_default_button = abap_true ).

lo_window->open( ).

Regards,

Radhika.