cancel
Showing results for 
Search instead for 
Did you mean: 

close the application from a window or a view

Former Member
0 Kudos

Hi,

I need to check some prerequisities in the WDDOINIT of a window. If they are not

available I send a pop up window to confirm to the user with the missing information.

When the Ok button is selected I would like the application to be exit, I mean I'd like the browser to disappear.

Any idea how to reach this?

I tried the following:

WDDOINIT of the view checks prerequisities, if not avaialable, the view sends a

confirmation dialog. the ok button of the pop up is handeled by the action call_exit of this view.

This action fire an outbound plug to an inbound plug of the window.

The handle function of the window's inbound plug fire an intreface exit plugout.

According to

http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm

the associated application should end automatically.

The effect I get is that the window disappears and the browser content gets completely white.

I would like the browser (client) window to disappear, as well.

Is this possible?

kind regards,

Sahla

Accepted Solutions (1)

Accepted Solutions (1)

I039810
Advisor
Advisor
0 Kudos

Hi Sahla,

Please try to get the reference to the window (IF_WD_WINDOW) and call the close method.

Thanks,

Shalini

Former Member
0 Kudos

Hi Shalini,

I did the following in the handle method of the exit button:

-


DATA: lo_view_contr TYPE REF TO if_wd_view_controller,

lo_win_contr type ref to IF_WD_WINDOW_CONTROLLER,

lo_win type ref to if_wd_window.

lo_view_contr = wd_this->wd_get_api( ).

*get window controller of embedding window.

lo_win_contr = lo_view_contr->get_embedding_window_ctlr( ).

*get window

lo_win = lo_win_contr->get_window( ).

lo_win->close( ).

-


The last operation breaks with an exception.

The window that Iwant to close is not the pop up window but the main window and the whole application.

I think firing the exit plug is the right way to do it. My question is why the application is not closed?

kind regards,

Sahla

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sahla,

Our Application is Java WebDynpro Application

We have a portal window, in Which we access an another window( which is a webdynpro page)

we work only on the webdynpro page

inside this page there is a Close Button

on click of this it should close the main portal window

But we are not able to get the instance of the main portal window

do you have any idea about whether this can be solved using WDPortalEventing.fire any close window event

Thanks & Regards

Swetha

Former Member
0 Kudos

Hi Swetha,

I am not really a WD expert.

When you define the outbound plug as an exit plug the whole application is exit - under certain conditions.

If this does not work, I would try to define an outbound plug of the indow to

an inbound plug of the portal. The function treating the inbound plug fires an exit plug or event of the whole portral.

Take it just as an idea. I don't know what is a portal ( technically ).

kind regards,

Sahla

abhimanyu_lagishetti7
Active Contributor
0 Kudos

In the event handler of teh OK button,

navigate to a BSP page using [Exit Plug|http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm].

you can write javascript inside the BSP to close the window. i.e. window.close();

user will not see the effect immediately the window gets closed

Abhi

Former Member
0 Kudos

Hello,

thank you all for rely.

I solved the problem in the following way:

(I found this in a previous forum question)

So basically the exit plug is fired, but the setting the CLOSE_WINDOW parameter is necessary!

I didn't do this in my firt trial.

method ONACTIONON_COMPLETE .

data : l_view_cntr type ref to if_wd_view_controller,

l_win_cntr type ref to if_wd_window_controller,

l_window type ref to if_wd_window,

l_parameter_list type wdr_event_parameter_list,

l_parameter type wdr_event_parameter,

l_val type ref to data.

field-symbols <fs> type any.

l_view_cntr = wd_this->wd_get_api( ).

l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).

l_parameter-name = 'CLOSE_WINDOW'.

create data l_val type c.

assign l_val->* to <fs>.

<fs> = 'X'.

l_parameter-value = l_val.

insert l_parameter into table l_parameter_list.

l_win_cntr->if_wd_view_controller~fire_plug(

exporting plug_name = 'EXIT_PLUG'

parameters = l_parameter_list ).

endmethod.

kind regards,

Sahla

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> In the event handler of teh OK button,

> navigate to a BSP page using [Exit Plug|http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm].

>

> you can write javascript inside the BSP to close the window. i.e. window.close();

>

> user will not see the effect immediately the window gets closed

>

> Abhi

In NetWeaver 7.0 EnhP1 you can use the Close window option of the exit plug as long as your browser is IE. This would avoid the need to call over to a BSP application. The only drawback to that approach is that it only works if your portal is NetWeaver 7.1 - which isn't release yet - and only works in Internet Explorer.

Former Member
0 Kudos

Hi,

We are writing for Netweaver 7.1 and as far as I know we are using IE.

I would say: I had good luck

kind regards,

Sahla