cancel
Showing results for 
Search instead for 
Did you mean: 

closing of a window

Former Member
0 Kudos

hi friends for closing a window we created one close button in view and we implemented code for this event handler but according to my requirements iam placing the code under wddoonexit method of component controller but iam getting errors.how i can close application by using code that is written under component controller wddoexit method without using closing button

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

explain what the above code doing

Edited by: ravidanda on Mar 8, 2011 6:06 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Folks,

This site is very helpful who want to learn SAP.

Former Member
0 Kudos

What was the reason that you coded this in wddoonexit and not in the event handler of the close button in the view ?.

wddoonexit method is called by the framework when the component is destroyed. Like my friend Saarbjeet already said , if your intention is to close this application then you might have to stick with firing exit_plug.

See info on the exit plug [https://cw.sdn.sap.com/cw/docs/DOC-24322|https://cw.sdn.sap.com/cw/docs/DOC-24322]

Edited by: Baskaran Senthivel on Mar 8, 2011 10:14 PM

gill367
Active Contributor
0 Kudos

Hello Ravi,

what is the requirement that you want to achieve by writing this code in wddoexit method.

however this code is firing a plug EXIT plug and it will close the application no tsure whether it is working.

and anyways doexit itself will come into play only when you exit the application.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi friends,

by using close button some action will trigger but i want to get that action by closing(X) symbol of window or component also that's why iam writing code under wddoexit method.

For example if we are closing a window by using close button we will get information like 'you are closed window" .my requirement is i will get this information whenever we close a window by using X symbol of window.

Former Member
0 Kudos

Hi Ravi,

Try this.. it mights solve your problem.

http://wiki.sdn.sap.com/wiki/display/WDABAP/CloseParentWindow-WDA

Cheers,

Kris.

Former Member
0 Kudos

Hi,

the closing of a window is via the upper right cross of window instead of using the close button.Now u got my point

Former Member
0 Kudos

Hi ravi,

If the application is running in portal.. using WORK PROTECT MODE option.

and also go through this... you get some idea.

Cheers,

Kris.

Edited by: kissnas on Mar 9, 2011 6:09 AM

gill367
Active Contributor
0 Kudos

>

> Hi,

> the closing of a window is via the upper right cross of window instead of using the close button.Now u got my point

then it will be automatically closed.

why you need to write a logic for that.

application and component will be destroyed.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi

if the closing of a window is via the close button then it show you closed window information.i need this information when we are closing a window via upper right cross of window also. for this how can i approach?

Former Member
0 Kudos

Hi Ravi,

In webdynpro side it is not possible, at portal side you can do this using WORK_PROTECT_MODE.

check my above post for help.

Cheers,

Kris.

Former Member
0 Kudos

Hi,the link that u posted function that is going when i click on close button i want that function also when i close upper right cross of window.it is notp ossiable?

gill367
Active Contributor
0 Kudos

In the wdodoexit you cannot do anything like that to give a popup

when the window is closed from the X button you cannot stop it.

only option is workprotect mode if you care using portal.

thanks

sarbjeet

Former Member
0 Kudos

Hi,

you mean to say donot write any code in WDDOEXIT of component controller.If not at what time we implement code under that method

gill367
Active Contributor
0 Kudos

WDdoexit is only used to clear or release the locks

like you can write some statements involving realsing the lock after the database update.

but navigation way you cannot alter in the wddoexit.

thanks