Skip to Content

How to close parent window in Webdynpro applications?.

Its has been daunting problem for us to close the parent window through some actions. But this can be achieved through a work around .Please follow the steps.

Step 1.

   Create an outbound plug in your view , O__EXIT.


Step 3.

  Create an outbound plug in your window , O__EXIT , while creating the plug make sure that you make it as an exit plug.

  In the normal course , system will not allow you create an exit plug unless and otherwise you specify the plug as an interface one. 


Step 4.

    Go to your  HANDLEI_MAIN_EXIT method in your window and fire the exit plug.

  >>>>>> wd_This->Fire_O_V_Main_Exit_Plg( ).

Step 5.

   Go to the window create the navigation link from the outbound plug of your  “


Step 8.

Whenever you want to close the window fire the outbound plug >>>>>> wd_This->Fire_O__Exit_Plg( )  From your code.

You must be Logged on to comment or reply to a post.
  • Hi Buddy ,
    Thanks a lot . I was knowing that to take exit from WD Application we need to do something like this but no where detailed proper procedure was given ...Great Thanks A lot
  • Hello,
    Nice information to share. I have done all the settings. But when in sicf I click on the change button to add the html code i got the following info.

    No HTML error document maintained

    So I am not able to add the code in the sicf.

    Aashish Garg

  • Hi
      There is an alternate approach available with the use of an html page.

    Follow the steps till 5.But in the step 3 when you create the Window Exit plug of type exit plug , make sure that , you provide a parameter URL for that of type STRING.So you window exit plug will be accepting URL(Type String ) as a parameter.

    Now Follow the steps till 5.

    Skip steps 6 and 7 .Rather you creat a new html page in your notepad and name it a close.html

    Inside the close.html write the following code.

    Now save this file on your local machine , and then upload this to the MIME repository of your SAP System.

    In My case i uploaded the file to

    Now go to step 4 of the blog , and when you call the exit plug of your window , rephrase it like this

    wd_This->Fire_O_V_Main_Exit_Plg( URL = '/sap/bc/bsp/public/close.html' ).

    Now follow step 8 , the parent window will get closed


    • This one worked for me .. one needs to be careful about the path of the file(html) and rest is smooth ..for path u may wanna visit your MIME repository ..
    • Hi Anzy,

      Can you please tell me where and how u put your html fine in SICF.
      I am trying to do the same but not getting any upload or reference link to put my html file in SICF.

      I even uploaded the html file to my WDA apllication MIME repository but dont no what is the URL of this mime repository object.


  • Hi,
       We have developed an architecture where in we have buttons in a child component (to reuse it) and all the other UI elements are in a parent component from where the interface view of the child component is called.
       For one of the buttons of the child component, I have followed this blog to close the browser window putting all the plugs in the child component but it doens't work. Can someone suggest me some solution on this.
       Thanks in advance.


  • Hi,

    when trying the closing script codes in this blog and the previous comments, I always geht the browser message:

    "The webpage you are viewing is trying to close the tab.

    Do you want to close this tab?"

    With IE6 I accomplished to switch off the message with the following code in the logoff error page of the SICF service node:


    But unfortunately Microsoft has closed this friendly "gap" for the IE7.

    Do you know how to get rid of this annoying browser message?



  • Thanks for this amazing Blob... i have a small problem implementing it... pls can u help me..

    When i click on link to action 'Exit Application' it gives me a msgbox as to 'DO u want to exit the application ?' with yes/No Options..

    when i select Yes.. the above blog functionalities work but if i click on no... i get a blank page (How can i get my last status in place of this blank page..)


  • Hello Anzy,
    Thanks for this blog! This is wonderful. I used your method for a couple of webdynpros that run on a browser and it worked perfectly. However in one particular scenario, for some reasons, it fails.

    Here is the overview of it.
    In R/3 workflow, for a task, I'm using a Webdynpro application as the step. So when this workitem shows up on Portal UWL(inbox) and when i click it, this gets opened up as a SAP WEB GUI object. So its basically an internet explorer that has SAP GUI kind of screens inside it.

    Here the same method doesnt work. It just shows the error page as Page cannot be found. Can you please let me know what I should do to get this fixed?
    Appreciate your help!


  • Thanks alot for putting in the document its a gr8 help.
    However, i am facing a problem. I used the same method to close my parent window(in same web dynpro application) when i press on ok button of a popup window. I am getting the following error.
    Navigation in Phase WDDOMODIFYVIEW Cannot Be Triggered. Component: ZIM_LTA, View: MAIN, Window: ZIM_LTA

    can any one help please!!

  • I found the following piece of HTML code on the net which suppresses the warning pop up. It simply gives you a button which when pressed closes the window.