Closing an external window

Hello,
I would like to close an external window dynamically by calling the method
lr_myextwin->close( ) when some event occurs.
This does not seem to work since the opened external window is still open...
Ofcourse it is possible to manally close the external window, but I would like it to happen dynamically.
Can any brief me in, if it possible.
Cheers,
Gerald

Hi Jagruti,
   Its possible to close the external window dynamically.What you have to do is , while creating the external window instance, save the instance in the component controller as an attribute .
Which means create an attribute in the component controller of type IF_WD_WINDOW ( In this case i have created LO_POP_UP ).
  l_cmp_api = wd_comp_controller->wd_get_api( ).
  l_window_manager = l_cmp_api->get_window_manager( ).
   CALL METHOD L_WINDOW_MANAGER->CREATE_WINDOW
     EXPORTING
      MODAL                = ABAP_TRUE
       WINDOW_NAME          = <WINDOWNAME>
      TITLE                =
      CLOSE_BUTTON         = ABAP_TRUE
      BUTTON_KIND          =
      MESSAGE_TYPE         = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
      CLOSE_IN_ANY_CASE    = ABAP_TRUE
      MESSAGE_DISPLAY_MODE =
      DEFAULT_BUTTON       =
     RECEIVING
       WINDOW               = l_final_window
When you get the instance of the window.Save it in the component controller attribute.
wd_comp_controller->LO_POP_UP = L_FINAL_WINDOW.
CALL METHOD L_FINAL_WINDOW->OPEN
At later point of time , you could get this instance from compenent controller and you can call that in your method whenever and whereever necessary , so that you could close the window in a smooth fashion.
mywindow = wd_compcontroller->LO_POP_UP
mywindow.close().
Thanks
Anzy.
mark this thread as closed if this solves your problem.

Similar Messages

  • Closing the external window

    Hi,
    I am new to webdynpro ABAP, please someone help me in how to close the extenal window, from the application running on the external window.
    I am actually creating a URL for a webdynpro component and I am running it on the external window, now I want to close the application browser, so that I can go back to the source window.
    Regards,
    Kamaraj

    Hi,
    if you are using URL external window then they are two separate sessions. You have no connection as parent and child window and nothing forbids the user to go from one window to another window.
    If this is really your use case and you want to close your own application/window by an button action or event handler method. Then you have to find out a way to close your application by an action.
    see this forum discussion.
    [FORUM|Re: Close External Window in Web Dynpro Application]

  • Closing the NonModel External Window in Webdynpro

    Hi,
    I have a Webdynpro Application, in which i used to call the webdynpro application in a Separate external window by using the below code.
    String depObjectName =wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
    WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"TestApp",WDDeployableObjectPartType.APPLICATION);
    String url = URLGenerator.getApplicationURL(depObjectpart) ;
    *// Code to Popup the View in External window by calling the Application                          *
    window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"Update View");
    wdContext.currentContextElement().setCtx_WindowInstance(window);
    window.setWindowSize(625, 225);
    window.setWindowPosition(50, 75);
    *window.setTitle("Update View");          *
    window.show();
    This opens the Separate external window and after editing some fields, I need to Update the DB and close the window.
    When i try to use the code,
    window.destroyInstance();
    The window is not getting closed. I have used the window instance as the static IWDWindow window, still i am not able to close the window.
    Anyone Please let me know how to close the External Non Model Window.
    Thanks and Regards,
    Sekar

    Hi Sekar,
    my suggestion is to open another window that contains html code which invokes opener . close() on the parent window - your window to be closed. This worked for me and made my day.
    I open an HTML file created as IWDCachedWebResource as nonModalExternalWindow over a LinkToAction which invokes onActionClose. There is a second window opening for a short moment which will be closed by its onLoad event.
    The HTML code is basically sporting a < script >-section which contains a call to opener . close().
    regards,
    Christian
    Ps: sorry, I can't post the code - it simply does not work... Had the same problem days ago with another thread .

  • Closing External Window

    Hi,
    I want to close an external window (an external running application, such as InfoConnect, or NotePad etc) using a simple java program. Is it possible? What is the command to close an external window? And how do I know which window to close?
    For example, there's a running application, called info-connect, and another independent java program running. How can I close the info-connect window without disturbing the other program? (is there a name for the window or something)
    Thank you very much!!! Wish you all the best~
    - Anson

    Sorry, I hit the 'post' button a little too quick.
    If it's really independent, it's gonna be very hard - though a Robot might get you somewhere.
    But more importantly, there's a reason for that. How would you like it if a program just decided that a window it hadn't opened, needed to be closed? I'd find it irritating to say the least.
    Don't close what you do not own.
    Otherwise:Process p = Runtime.getRuntime().exec("MyProgram.exe"); // start a process
    ... // do some stuff
    p.destroy(); // kill itBut this is probably not what you mean by independent, right?

  • FileDownload UI - Closing external window

    Hi All,
        I am using the file download UI, and as I want to show open dialog box after file download, the property 'behaviour' is set to 'allow save' , and it is working fine too.
      My requrement is, after I click 'Open' or 'Save' or 'Cancel' button, the external window should close automatically. i.e. the user need not want close it.
    Any idea ?
    Thanks,
    Prabhakar.

    Hi,
    As wd doesnt java scripts closing windows at the client side will not be possible.
    Regards
    Ayyapparaj

  • Close External Window in Web Dynpro Application

    Hi Folks,
    I am working on a development in Web Dynpro and I am pretty new to this topic, so I seek your help.
    The scene is:
    I have created a Web Dynpro application in which I open an URL using CREATE_EXTERNAL_WINDOW method of the Window Controller. I am able to open the window but not able to close it.
    I tried using methods,
    CLOSE()
      and
      SET_CLOSE_IN_ANY_CASE()
      but no success.
    Please guide me if anything more needs to be done for closing the opened window.
    Thank you.
    Sud.

    Thank you Thomas,
    You correctly pointed out, I was trying to close the external window from my source window.
    More precisely, I have a WD application which has a button (Search) on one of its views. On click of 'Search' button, I open a new window using 'CREATE_EXTERNAL_WINDOW' passing the URL 'www.google.com'.
    Till this point its fine, but now I want to close this newly opened window. As you said now these are 2 different sessions and cannot communicate anymore, so any guidance how to close this new window?.
    OR
    Is this the only way to call an URL i.e using CREATE_EXTERNAL_WINDOW? Is there any other way to call an URL without closing my current running WD application?
    Request your  help......
    Thanks.
    Regards,
    Sud....

  • Application lock on open external window

    Hi everybody,
    I have problems with opening a new browser window pointing to a folder on the network.
    If the user has access to the folder everything is working fine.
    If the user has no rights to access the folder, the user gets an error message and the window stays empty. After clicking okay on the error message and closing the window the  user can continue working in the application.
    If the folder which should be display does not exist the user gets an error message.
    After clicking oay on the message he can return to the application. But there the 'progress circle' is still running and it cannot abort or do anything! The user has to close the application and login again.
    Is there a way to handle the external window in any way after having it opened and the calling method was left?
    Any hint or advice is highly appreciated!
    Best regards,
    Roland

    Hi,
    Do this way... So that there will not be a minimise option, close option. and control will be there inside the Window and till the time user closes the window he cannot perform any actions on any other screens.
         //Added below code to open a new window
              IWDWindowInfo info =
                   wdComponentAPI.getComponentInfo().findInWindows("WD_vendorTable");
    //Where WD_vendorTable is a window with the desired view embedded inside it.
              IWDWindow win =
                   wdComponentAPI.getWindowManager().createModalWindow(info);
              wdContext.currentContextElement().setVa_VendorWinName(win);
    //Save this window information in a context variable(declared at component level and mapped to the parent view and to the window(child) view)
              win.setWindowSize(300, 300); //Desired window size
              win.setWindowPosition(600, 100); //Desired window position (from top left cornor)
              win.setTitle("Vendor Details"); //Desired window title
              win.show();
    To close this window
    create a button inside it and inside the button's action
    IWDWindow win=wdContext.currentContextElement().getVa_AssetNoWinName();
    win.destroyInstance();
    Regards,
    Srinivas.

  • How lock or hide URL LOCATION in a external windows WDA

    Hello guys...
    I am traying to hide or block the URL which i am using in a external window. I have coded this:
       call method lo_window_manager->create_external_window
    exporting
       url            = lv_url
       modal          = abap_true
       has_menubar    = abap_false
       is_resizable   = abap_true
       has_scrollbars = abap_true
       has_statusbar  = abap_false
       has_toolbar    = abap_false
       has_location   = abap_false
    receiving
       window         = lo_window2.
    *lo_window2->open( ).
    But, firstly the MODAL parameter doesn't work with external windows (It's Obsolete) So I can't use it, because I have to forbid the navigation between windows. I tried to close the main windows before open URL but it doesn't work either.(Appear a waring that you window wants to be closed) so then I used that:
      lo_windows->fire_exit_url_plg(
        url = lv_url                              " string
      lo_windows =   wd_this->get_windows_ctr( ).
        lo_windows->fire_exit_close_plg(
          close_window = 'X'                     " wdy_boolean
    That is Ok BUT I can't BLOCK the URL or even HIDE it. SOMEBODY give the light.!!!!! pleaseee..

    You are complexing with 2 problem with 2 options.
    1. Blocking url on the external window
    2. Closing the previous window.
    1. parameter model is indeed obsolete, so only has location parameter  would help you to block the URL and it will not work for the requirement 2.
    2. When you use exit plug and navigate to new URL, your window would close but new window would not open with address bar blocked.
    No solution is fitting for your both requirements.
    Probably you have seen this example application WDR_TEST_EXIT_WITH_CLOSE
    See if it fits in your case.

  • How to create external window on top of other window?

    I create an external window from my web dynpro component. How to make sure the new window is created on top, not in the back? My web dynpro component is accessed via sapgui and browser.
    Thank you
    Edited by: Vincent Cao on Jun 15, 2010 5:25 AM

    Yes, by default it should be on top.But mine is displayed in the background.
    Logic is:
    1 Window A (or SAPGUI A) has a pop window PA with a button "OK"
    2 Press "OK" button, PA window is closed. And fire an event to window A
    3 A get the event, refresh itself and create an external window.
    Part of codes:
          window = lo_window_manager->create_external_window(
              url            = i_url
              title          = title
              modal          = modal  " abap_false
              has_menubar    = has_menubar "abap_true
              is_resizable   = is_resizable "abap_true
              has_scrollbars = has_scrollbars "abap_true
              has_statusbar  = has_statusbar "abap_true
              has_toolbar    = has_toolbar "abap_true
              has_location   = has_location ). "abap_true
          IF width IS NOT INITIAL AND height IS NOT INITIAL.
            window->set_window_size( width  = width  height = height ).
          ENDIF.
          window->open( ).

  • Again about External Window in WDA

    I have some troubles with running new processes in E-Recruiting.
    It is necessary to run my process when I'm pushing the button in the requisition form. I'm creating external window with method CREATE_EXTERNAL_WINDOW and after that my process is running. This chain is workable. But when I'm closing this window with my process there is no new small window which displays that the session is completed.
    Call method:
      call method lo_window_manager->create_external_window
        exporting
          url            = lv_url
          modal          = abap_false
          has_menubar    = abap_true
          is_resizable   = abap_true
          has_scrollbars = abap_true
          has_statusbar  = abap_true
          has_toolbar    = abap_true
          has_location   = abap_true
        receiving
          window         = lo_window.
    I don't find any usefull parametrs in this method.

    Sorry I might be about to be rude,
    But are you/your users crazy? They actually will complain if a session termination popup doesn't appear? You must have the most observant and tech aware end users in the world. Most of the users I deal with install pop-up blockers that stop the portal session termination popup - the ability to deal without it in WDA was a blessing. If your users are really that "aware" of session management then explain to them that WDA handles this within the same window.
    I really cannot understand this improvement in functionality offered by WDA is a problem...

  • Close external window in NW04s

    Hi,
    We are using the following API in order to close an external window: TaskBinder.getCurrentTask().getClient().sendRedirect("javascript:window.close();",0);
    After closing the window, the object in the backend system remain locked (and not released). it seems that the session remains alive and hence the object is locked.
    If we close the window with the X of the window, the object of the backend is released as required.
    As suggestions?
    Thanks,
    Aviad

    Hi AVIAD,
    Check this.
    Step 1: Take a context attribute(WindowInstance) of type “com.sap.tc.webdynpro.services.session.api.IWDWindow”.
    Step 2: Take a CloseButton in the View(DisplayView) that is used as a embed View of external Window.
    Step 3:
    When you are calling the external window set “WindowInstance”
    public void onActionDisplayExternal Window(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDisplayResult(ServerEvent)
         IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
         "DisplayWindow");
    //        create the Window
         IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
         window.setWindowPosition(WDWindowPos.CENTER);
         window.setTitle("WindowTitle");
         window.setWindowSize(100,100);
    //        Save WindowInstance in Context
         wdContext.currentContextElement().setWindowInstance(window);
    //        and show the window
         window.show();
         //wdThis.wdFirePlugInDisplay();
        //@@end
    Step4: Associate action “CloseWindow” with the “CloseButton
    ” and destroy the window instance inside it.
      public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCloseWindow(ServerEvent)
       IWDWindow window = wdContext.currentContextElement().getWindowInstance();
       window.destroyInstance();
        //@@end
    External Window
    Re: Exit button error...
    Regards,
    Mithu

  • Problem with Absolute Navigation (External Window) and Light Framework Page

    Hi All,
    We are using Light Framework page for the portal devolopment. We have an application including two webdynpro iviews where absolute navigation is used to traverse from first iview to second iview (When user clicks a button on first iview). We are showing the second iview in external window (SHOW_EXTERNAL). When ever i clicks the button to traverse to second iview, i am getting an exception.
    When we are showing it in same window (SHOW_INPLACE), it is working fine. But the iview is appeared in half of the page with scrollbars. It is working fine with default framework page (with both options SHOW_INPLACE and SHOW_EXTERNAL) and dispalyed in original size as mentioned in iview properties.
    Could you please suggest us whether there is any work around for this.
    Thanks,
    Sudheer

    Hi Kathiresan
    I couldn't see the address bar of the window (In which second iview is getting displayed). But i can observe no parameters that i passed from first iview is visible in the view source of the second iview (When SHOW_EXTERNAL is used in absolute navigation). I could see all the parameters in the view source (when SHOW_INPLACE is used for absolute navigation). But i am using the same url for both the options (for SHOW_INPLACE and SHOW_EXTERNAL).
    I doubt about the url being passed when SHOW_EXTERNAL option is used. But when we checked in debug, The correct url is being triggered (Atleast from first iview). Is there any way that could display the second window with address bar. What is making difference  between SHOW_INPLACE and SHOW_EXTERNAL with absolute navigation and light framework page.
    Could someone please suggest.
    Thanks,
    Sudheer.

  • Open URL in a new window by closing the parent window

    Hi Friends,
    Is there any option to open URL in a new window by closing the parent window on a button click?
    Already implemented the logics suggested in /people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications , the thread ' URL in same window '  and the standard component WDR_TEST_EXIT_PLUG .But button is not triggerring any actions .plz help me  ..............
    Regards,
    Radhika

    hi,
    Do the following steps :
    -> Make an Outbound Plug to the Window.
    ->Make the type of Outbound plug to Exit Type.
    ->Add URL of type String as a parameter to the outbound plug of Window.
    ->Do remember to add Component Name in the Properties Tab of View ( othervs Calling Outbound plug of window from view wont b possible ).
    To open a new URL with closing the previous one write this Code in OnAction of Button : ( this Code can be get from Code Wizard too ).
    DATA lo_zexit TYPE REF TO ig_zexit .   <zexit is name of my Component>
    lo_zexit =   wd_this->get_zexit_ctr( ).
      lo_zexit->fire_out_window_plg(
        url =   'http://www.google.com'                            " string
    I hope it helps.
    Thanx.

  • I want to reset Firefox, and the message is that something is preventing the reset. I have closed all open windows and I still get the "Oops" message,

    I have uninstalled and reinstalled Firefox because I was receiving unwanted adware and was being directed to untrusted sites. Now I want to reset Firefox because I want to change the home page and toolbars, and something is preventing the reset. I have closed all open windows repeatedly, but the problem continues.
    =====Moved from Firefox OS product to Firefox for Desktop product category by Moderator. -feer56=====

    Check the programs that are on your computer
    '''Windows:''' Start > Control Panel > Uninstall Programs.
    '''Mac:''' Open the "Applications" folder
    '''Linux:'''
    * [http://www.freesoftwaremagazine.com/articles/see_all_your_installed_applications_ubuntu_unity Ubuntu Unity]''' {web link}
    * Xfce: Applications Menu category sections
    * options depends on the package manager and the desktop environment
    Go thru the list. If you find something that you don't
    know what it is, use a web search.
    '''''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-caused-malware Troubleshoot Firefox Issues Caused By Malware]''''' {web link}

  • Why does closing all open windows (15) and leaving only one drop ram usage from 1.5 to 1.4Gb and not more.

    Why does closing all open windows (15) and leaving only one drop ram usage by only 100mb from 1.5 to 1.4Gb.
    What is in this 1.4 gb ?
    I don't care much about ram, It's just that cpu usage spike like crazy by the end.
    ''Edited to remove swearing - TonyE''

    Hi musicfan,<br />Sorry you are having problems with Firefox. Maybe you should have asked earlier and we could have fixed it.
    Reading your comments I do not see that rolling back to an insecure Firefox 22 will actually help you much. You are probably best using IE, unless you have also damaged that.
    *[[Export bookmarks to Internet Explorer]]
    You should not use old versions they are insecure. Security fixes are publicised and exploitable.
    * [[Install an older version of Firefox]]
    * https://www.mozilla.org/security/known-vulnerabilities/firefox.html
    Most others will not be having such problems. We are now able to say that with confidence because after developers missed a regression in Firefox 4 telemetry was introduced so that data was obtained. It may be an idea to turn on your telemetry, if you have not already done so, and decide to stick with Firefox.
    *[[Send performance data to Mozilla to help improve Firefox]]
    Trying safe mode takes seconds. Unfortunatly if you are not willing to do even rudimentary troubleshooting there is not anything we can do to help you.
    *[[Troubleshoot Firefox issues using Safe Mode]]

Maybe you are looking for

  • MBP won't wake, is REALLY HOT, fans going full blast

    This morning I made sure when I closed the lid on my MacBook Pro, that it went to sleep (pulsing sleep light). I found that this doesn't always happen right away, unlike the old Powerbooks. I then put it into my laptop bag, confident that it was full

  • My Lumia 820 just died :(

    I was texting friends yesterday evening with my phone plugged in and suddenly it froze. The buttons would not work. Not the off or on button, not the camera button, not even the volume button. It was completely frozen on a text. I decided to leave it

  • HDD connected to my Airport

    If I were to buy the new Airport Extreme would I be able to connect my backup HDD to it via USB and have Time Machine backup to that HDD? I have been hearing mixed reports on this. Can anyone confirm for me if it works or not?

  • BAPI for SAP HR (travel ticket request - TRIP)

    Hi all. I need to create a Travel Request with Travel Tickets from remote (using Tibco middleware). In other terms, I have to "expose" the TRIP transaction as a remote service. The standard BAPI_TRIP_CREATE_FROM_DATA is not sufficient because it allo

  • Error when trying to remove blob: There is currently a lease on the blob and no lease ID was specified in the request.

    I'm having this error when I try to remove a blob that was used for a VM in the pass, the VM was already removed and there's nothing using that blob nor even the storage account wh ere the blob is stored. There is currently a lease on the blob and no