on 02-28-2012 11:40 AM
Hi experts,
I am trying to close the main window ( when WD application is executed the html page which displays should be closed ) if i press the exit button.
I have tried using different methods of if_wd_windowcontroller and window_manager none of them worked.
I have used the outbound plug in the window and type of this plug is EXIT. I am triggering this plug in the on action method of corresponding exit button.But output is not coming.
Please give inputs about this.
Hi Ravi,
This must solve your problem.Use the code in your button action.
wdr_task=>client_window->client->send_close_window( ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Direct access to WDR_TASK is not supported. This class in particluar has very low level access and can allow all kinds of situations which break the Web Dynpro Phase Model and framework.
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/c4/b3670f72ff42eb8d4a508defd7f7a1/frameset.htm
Hi Thomas,
>
> As you told direct access to WDR_TASK is not supported. We have been using this class to download
> data to excel. So do you recommend any other way for downloading data.
>
> Can you please brief me regarding the usage of this class?
You should never need to use WDR_TASK to download data. Instead use the public API CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE.
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/13/a1764299d76255e10000000a155106/frameset.htm
You should only attempt to close the main browser window with the CLOSE_WINDOW flag of an exit plug. There are some situations where this isn't allowed, but they are all documented in the online help.
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9b/65e04ea1ae4d9d8cfd329afa43e869/frameset.htm
HI,
Pass the CLOSE_WINDOW in parameter it will work.
Thanks
Karthik.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this,
DATA LO_WINDOW TYPE REF TO IF_WD_WINDOW.
DATA LO_WINDOW_controller TYPE REF TO IF_WD_WINDOW_controller.
DATA LO_VIEW_CONTROLLER TYPE REF TO IF_WD_VIEW_CONTROLLER.
LO_VIEW_CONTROLLER = WD_THIS->WD_GET_API( ).
lo_window_controller = LO_VIEW_CONTROLLER->GET_EMBEDDING_WINDOW_CTLR( ).
lo_window = lo_window_controller->get_window( ).
lo_window->close( ).
Regards
Srinivas
Edited by: sanasrinivas on Feb 29, 2012 3:41 PM
first you declare a Global attribute @ Component level lo_window type ref to if_wd_window.(mark it as public,interface)
data : win_comp type REF TO if_wd_component.
data : win_mng type ref to if_wd_window_manager.
data : win type REF TO if_wd_window.
win_comp = wd_comp_controller->wd_get_api( ).
CALL METHOD WIN_COMP->GET_WINDOW_MANAGER
RECEIVING
WINDOW_MANAGER = win_mng.
CALL METHOD WIN_MNG->CREATE_WINDOW
EXPORTING
WINDOW_NAME = 'WINDOW' 'here provide your window name
RECEIVING
WINDOW = wd_comp_controller->lo_window.
CALL METHOD wd_comp_controller->lo_window->OPEN.
______________________________________________________________________
Then in your Exit event <On action>
close the current window
wd_comp_controller->lo_window ->close( ).
This will definitely help you.....
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.