cancel
Showing results for 
Search instead for 
Did you mean: 

How to create non modal windows / pop-ups in WD4A ?

Former Member
0 Kudos

Hi All,

How can we create non modal windows / pop-ups in WD4A ?

Thanks & Regards

Gaurav Jain

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gaurav,

To create pop-ups in wda, you can use 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_api TYPE REF TO if_wd_view_controller,

l_text TYPE string_table,

line1 TYPE string,

l_title TYPE string.

l_cmp_api = wd_comp_controller->wd_get_api( ).

l_window_manager = l_cmp_api->get_window_manager( ).

l ine1 = 'Hello this is popup'.

l_title = 'Confirmation Window'.

INSERT line1 INTO TABLE l_text.

*" Create the pop up

*" See interface if_wd_window for buttonkinds and message types

l_popup = l_window_manager->create_popup_to_confirm(

text = l_text

button_kind = if_wd_window=>co_buttons_yesno "co_buttons_yesnocancel

message_type = if_wd_window=>co_msg_type_question

window_title = l_title

window_position = if_wd_window=>co_center

close_button = abap_false ).

l_api = wd_this->wd_get_api( ).

*these actions are used to catch the user action, you need to write the code for each action

*so if user click yes btn, than you can do something, and if the user presses no, than you can do *something different

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_yes

action_name = 'ACT_YES'

action_view = l_api

is_default_button = abap_true ).

l_popup->subscribe_to_button_event(

button = if_wd_window=>co_button_no

action_name = 'ACT_NO'

action_view = l_api

is_default_button = abap_true ).

l_popup->open( ).

hope this helps....

J.

former_member402443
Contributor
0 Kudos

Hi Gaurav,

In Web Dynpro ABAP we can't create non-modal popup winodw but we can create external window with the help of CREATE_EXTERNAL_WINDOW method in the IF_WD_WINDOW_MANAGER interface.

This window will be open in a separate browser and there will be no link between your application and with this window. Data will not be passed between this window and your application automatically.

You have to use the parameter for passing the data in the application url.

Code for creating the external window :

DATA: lo_window TYPE REF TO if_wd_window,

lo_cmp_api TYPE REF TO if_wd_component,

lo_window_manager TYPE REF TO if_wd_window_manager,

lv_url TYPE string,

lv_title TYPE string.

  • get window manager

lo_cmp_api = wd_this->wd_get_api( ).

lo_window_manager = lo_cmp_api->get_window_manager( ).

  • create external window

lo_window_manager->create_external_window(

EXPORTING

url = lv_url

title = lv_title

has_menubar = abap_false

has_statusbar = abap_false

has_toolbar = abap_false

has_location = abap_false

RECEIVING

window = lo_window ).

  • open window

lo_window->open( ).

Hopes this will helps you.

Regard

Manoj Kumar

arjun_thakur
Active Contributor
0 Kudos

Hi Gaurav,

At present we can't create a non-modal pop up window in wd-abap.

Regards

Arjun