cancel
Showing results for 
Search instead for 
Did you mean: 

problem in pop-up

Former Member
0 Kudos

hi,

i m new in WD ABAP. On click of a button, i need to open a pop-up with two buttons.

in the first button functionality i have to come back to previous view, and with second button i have to save the data of first view input field.

plz tell how can i populate a pop-up with two buttons, and also how can i return back to the main view.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Also check this code .....

check this code....

method onactionaction .

data: l_cmp_api type ref to if_wd_component,

l_window_manager type ref to if_wd_window_manager,

l_popup type ref to if_wd_window,

l_text type string_table,

l_api type ref to if_wd_view_controller.

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

insert `Data where changed` into table l_text. "#EC *

insert `Do you want to save?` into table l_text. "#EC *

l_popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>co_buttons_yesnocancel

message_type = if_wd_window=>co_msg_type_question

window_title = 'Test: Popup to confirm'

window_position = if_wd_window=>co_center )."#EC *

l_api = wd_this->wd_get_api( ).

l_popup->subscribe_to_button_event(

button = '07' "if_wd_window=>co_button_yes

action_name = 'YES'

action_view = l_api

is_default_button = abap_true ).

l_popup->subscribe_to_button_event(

button = '08' "if_wd_window=>co_button_no

action_name = 'NO'

action_view = l_api

is_default_button = abap_false ).

l_popup->subscribe_to_button_event(

button = '06' "if_wd_window=>co_button_cancel

action_name = 'CANCEL'

action_view = l_api

is_default_button = abap_false ).

l_popup->open( ).

endmethod.

After this go to Actions tab of your view create actions for Yes,No and Cancel.

Thats all your proble will be solved.

Thanks,

Suman

uday_gubbala2
Active Contributor
0 Kudos

Hi Pankaj,

Just go through [this example|http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp_displaypopup.htm] and you will find the entire coding to display a popup window with the desired buttons. You can also go through this [2nd example|http://saptechnical.com/Tutorials/WebDynproABAP/Modalbox/page1.htm] in which the user enters a customer number in the main view & presses on a pushbutton. A popup is then displayed showing the list of all sales orders related to the customer in a table UI element. The user can then select a table row in the popup & click on a button to navigate back to the main view & display it in there.

Regards,

Uday

Former Member
0 Kudos

Hi,

Check this standard Program

WDR_TEST_POPUP_TO_CONFIRM

also check this document

http://help.sap.com/SAPHELP_NW04S/helpdata/EN/45/2233b60c21072ce10000000a155369/frameset.htm

Thanks

Suman