cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a pop up... in WDA...

Former Member
0 Kudos

Hi ,

I have a link in my WDA. this link is for a Sales order.

When i click this sales order link.. I will be reading the line items of this Order.

If no line items, .. i want to show a pop up stating " No line items for this Sales order" with OK button. If OK button is hit.. it should just show the WDA which has the order link.

Just to show a message.. to user in popup.

can u pls let me know the steps or code..

Niraja

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

hi niraja,

proceed in this way:

first of all create a new view. In this view either you can use a text view UI element and give the message in that or in the DOINIT method of this view you can use message manager with the help of code wizard.

now create a new window, embed the view in this window.

in the ONACTION method of the sales order link, check for the condition if line items are present.

if it is not , then use the code wizard to create a pop up window ( just pass the pop up window name which you just created). the 'ok' button will be created by default and when u'll click on it, it'll take you the view which contains the sales order link.

i hope it helps

regards

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

For creating the pop-up u have to use the method create_popup_to_confirm.

just use the following code.

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( ).

APPEND `No line items for this Sales order` TO l_text.

l_popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>CO_BUTTONS_OK

message_type = if_wd_window=>co_msg_type_question

window_title = 'Test: Popup to confirm'

window_position = if_wd_window=>co_top

).

l_popup->open( ).

Here in this you can change the meaasge type, window title etc.

For getting the options which can be suitable for these exporting parameters just double click on that and u will get the list of choices which u can use.

Thanks,

Pankaj Aggarwal

Former Member
0 Kudos

Hi Niraja,

Pls follow the link

it will definately help you.

Regards,

Anand

Former Member
0 Kudos

Hi ,

first of all you need to create a window and then you need to embed the view in that window .

this view would contain the UI elements you need to display .

on click of some action button , that pop up window should appear

as an examle on click of change button in my WD-ABAP application , a popup window would appear ,

than on click of ok button in that pop up , 'Z_POP_UP1' window should appear

refer the code below :

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 lr_view_controller TYPE REF TO if_wd_view_controller.

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 = 'Z_POP_UP1'

message_display_mode = if_wd_window=>co_msg_display_mode_selected

button_kind = if_wd_window=>co_buttons_okcancel

message_type = if_wd_window=>co_msg_type_question

default_button = if_wd_window=>co_button_ok ).

lr_view_controller = wd_this->wd_get_api( ).

lo_window->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

button_text = 'ok'

action_name = 'CHANGE'

action_view = lr_view_controller ).

lo_window->open( ).

this would help u