cancel
Showing results for 
Search instead for 
Did you mean: 

CREATE_EXTERNAL_WINDOW to call another WDA but close current WDA

Former Member
0 Kudos

Hi,

I am trying to call another WDA from a view of a currently executing WDA. The current calling WDA needs to be closed once the external WDA is open. I have called method lo_window_manager->CREATE_EXTERNAL_WINDOW to create the external window and closed the current window by firing an Exit output plug (setting input parameter CLOSE_WINDOW = abap_true) in the window where the view is embedded.

Unfortunately the external WDA is never opened but the calling WDA is closed.

However, if the exit plug is not fired, the external WDA does open correctly but the calling application is still open.

Any ideas on how this can be achieved.

Cheers,

John

Edited by: Support Soltius on Jul 19, 2011 2:00 PM

Edited by: Support Soltius on Jul 19, 2011 2:02 PM

Edited by: Support Soltius on Jul 19, 2011 2:03 PM

Accepted Solutions (1)

Accepted Solutions (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello John,

in the EXIT plug create an parameter URL of type string and while calling the exit plug set the URL value to your webdynpro component. its not required to call the create_external_window method

refer

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0018077-f0c9-2b10-87af-eb9bb40776d4?quicklink=index&overridelayout=true]

BR, Saravanan

Former Member
0 Kudos

Hi Saravanan,

Thanks for your reply.

One important thing I have omitted is that the WDA in question is one of iViews in a portal page and firing an exit plug opens the new WDA in the window of the second iView which unfortunately does not work well in this situation.

It is a very useful piece of functionality though and I have used it in other WDAs.

Cheers,

John

Edited by: Support Soltius on Jul 19, 2011 11:30 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

This was achieved by creating a timed trigger element for a delay for 1 second and setting an action that fired the Exit plug. A bit crude but effective.

  • ------------------------

  • Create timed trigger

  • -----------------------

DATA lr_container TYPE REF TO cl_wd_uielement_container.

DATA lr_matrix TYPE REF TO cl_wd_matrix_head_data.

DATA lr_timed_trigger TYPE REF TO cl_wd_timed_trigger.

  • wd_this->gr_view is set in the WDDOMODIFYVIEW method.

lr_container ?= wd_this->gr_view->get_element( 'ROOTUIELEMENTCONTAINER' ).

CALL METHOD cl_wd_timed_trigger=>new_timed_trigger

EXPORTING

delay = '1'

enabled = 'X'

  • id =

on_action = 'CLOSE_WINDOW'

RECEIVING

control = lr_timed_trigger.

lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_timed_trigger ).

lr_timed_trigger->set_layout_data( lr_matrix ).

CALL METHOD lr_container->add_child

EXPORTING

the_child = lr_timed_trigger.

  • -----------------------------

  • Create external window

  • -----------------------------

DATA: low_window TYPE REF TO if_wd_window_manager,

lo_comp_api TYPE REF TO if_wd_component,

lo_result TYPE REF TO if_wd_window,

lv_url TYPE string.

lo_comp_api = wd_comp_controller->wd_get_api( ).

low_window = lo_comp_api->get_window_manager( ).

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = WDR_MESSAGE_AREA'

IMPORTING

out_absolute_url = lv_url.

lo_result = low_window->create_external_window(

url = lv_url

  • title =

modal = abap_false

has_menubar = abap_false

has_toolbar = abap_false

  • has_location = ABAP_TRUE

).

lo_result->open( ).

*----


former_member184578
Active Contributor
0 Kudos

Hi.,

While Firing Exit Plug, Pass the URL of second WDA and close_window = 'X'.

hope this helps u.,

Thanks & Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

The following error message is returned when URL and CLOSE_WINDOW is specified:

With an exit plug the URL and CLOSE_WINDOW parameters are not permitted to be specified at the same time

Cheers

John

Edited by: Support Soltius on Jul 19, 2011 11:30 PM

Former Member
0 Kudos

May be you can do the following;

- add the external WDA as used component in the calling WDA

- create a method as event handler for an event created as interface in component controller in external WDA.

- use an exit plug within this method

- call to this method in the external WDA in the method WDDOINIT

try and tell us if works...