Close Popup window in webdynpro abap.

Hi,
Can anyone tell me ...how to close the popup window through the action in webdynpro abap . In my popup window there is a button(i.e 'UPDATE') apart from that  default 'OK' button , I want that when 'UPDATE' button is pressed, along with the action window should be closed. I dont want to close the window by pressing 'OK' button at the botton
I have used following code to open the popup window.
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component  type ref to if_wd_component.
data lo_window         type ref to if_wd_window.
lo_api_component  = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window         = lo_window_manager->create_window(
                   window_name            = 'POP_UP  WINDOW'
                   title                  = ''
                  close_in_any_case      = abap_true
                   message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                 close_button           = abap_true
                   button_kind            = if_wd_window=>co_buttons_ok
                   message_type           = if_wd_window=>co_msg_type_none
                   default_button         = if_wd_window=>co_button_ok
lo_window->open( ).

Hi Dear,
please try this code,
DATA lv_wc TYPE REF TO IF_WD_WINDOW_CONTROLLER.
data lv_view TYPE REF TO IF_WD_VIEW_CONTROLLER.
data lo_window  type ref to if_wd_window.
lv_view = wd_this->wd_get_api( ).
  lv_wc = lv_view->GET_EMBEDDING_WINDOW_CTLR( ).
   lo_window =  lv_wc ->GET_WINDOW( ).
   lo_window->CLOSE( ).
Message was edited by: kumar.k kulanthaivel
Regards,
K. Karthikeyan

Similar Messages

  • Remove Maximize button from popup window using Webdynpro ABAP

    Hi,
    Is there a way to remove the maximize button from a popup window using Webdynpro ABAP?
    Thanks,
    Jay

    Hi Jayanth,
    I think by setting is_resizable parameter pass abap_false. try this
    lo_window = lo_window_manager->create_window(
    window_name = 'POPUP'
    title = 'Window'
    close_in_any_case      = abap_true
    message_display_mode = if_wd_window=>co_msg_display_mode_selected
    message_type = if_wd_window=>co_msg_type_none
    is_resizable    = ABAP_FALSE ).
    Cheers,
    Kris.

  • Reg:working with multiple windows in webdynpro-abap

    Hi ,
    How can we create multiple windows and how can we link them...
    suppose we have 3 fields on first screen .how to move the data from the first screen to second screen..
    Thanks & Regards
    Suman Puthadi

    Hi
    As per your Subject you are looking for "working with multiple windows in webdynpro-abap" and for abap there is a different forum. Web Dynpro ABAP
    Hope its clear to you...
    Even you can read this post when ever you get time Read before posting
    Regards
    Ayyapparaj

  • How to create popup Windows in WebDynpro

    I am learning WebDynpro and have developed a sample application where i ask the user to login. In case of incorrect login I want to display a popup window which shows an error message and has an ok button on it. On click of the OK button i want to close the Window.
    I have created a view for this popup... called errorView
    On click of login button i perform validations n incase the validatins fail i have put in the following code
    IWDWindowInfo myWinInfo = wdComponentAPI.getComponentInfo().findInWindows("Ra_ErrorView");
    myPopupWindow = wdComponentAPI.getWindowManager().createWindow(myWinInfo,true);
    myPopupWindow.setWindowPosition(300,150);
    myPopupWindow.open();     
    How should i proceed?
    Where should i write the myPopupWindow.close()
    Kindly give a step-by-step solution.

    Hi Reema,
    You want to close a window say window1 which you opened from a view.
    create an attribute. select its type from java native settings to IWDWindow
    wdContext.currentcontextElement().setWindowInstance(window);
    1.create an event in component controller say event1
    2.In order to trigger the event in component controller create a method in it
    write this code in implementation of controller to trigger the event
    wdThis.wdFireEventAddressSelectedEvent();
    3.For catching whatever event that is responsible for closing the window create an event handler in view1 say eventhandler1.Choose the subscibed event to be event1
    4.In that eventhandler1 write the code in implementation
    IWDWindow window =
    wdContext.currentcontextElement().getWindowInstance();
    window.close();
    Hope this helps you.Do revert back if you have more doubts
    Regards
    Rohit
    Message was edited by: Rohit Radhakrishnan

  • How to auto close popup window of UWL?

    Hi everyone! I have developed a web dynpro abap application that is being launched by the UWL in a new window. How do I close the window after the web dynpro application is done processing? I cannot use exit-plugs as these don't work in the portal. If I use the portal navigation classes(absolute and relative) these ask for a target address but what I want is to close the window. Has anyone done this before? Thanks! Generous points will be awarded!

    If you are ready to open your webdynpro application inside the UWL itself (instead of opening as a pop up) you can try the following. In such a case you can set a re-direction page which points out to the URL of your UWL on the required action (say "Approve" or "Reject"). Hence when you perform the required action your UWL screen will be re-displayed once again.
    If you want only pop up from UWL then you may try posting it in Web Dynpro ABAP.
    Thanks,
    Prasath N

  • Save and close popup window

    I have a typical popup window launched using the builtin javascript:popupURL().
    I would like a Save and Close button on this popup window that does
    1. Submits the popup page so that changes are saved into session state
    2. Close the popup window
    3. Refresh the parent window so that updates in (1) are reflected
    What is the recommended way of doing this? I was thinking of the following URL redirect on the Save & Close button
    doSubmit('SAVE');
    window.opener.location.reload();
    window.close();Do I need a same-page branch on the popup page? If so, why? If not, why? ;-)
    Comments?
    Thanks

    This is a bit of javascript that I nicked which works well for me:
    -- 1. Add the folowing to your page header or create a new page template --
    -- (popup window template) and put it in the header section. --
    SCRIPT LANGUAGE="JavaScript">
    function loadinparent(url, closeSelf){
         self.opener.location = url;
         if(closeSelf) self.close();
    </SCRIPT>
    -- 2. Use the following to call the function. the true and false keeps the parent--
    -- window open or closed. Obviously set any values in the URL. --
    javascript:loadinparent(''<URL>'', true)
    eg. javascript:loadinparent(''f?p=&APP_ID.:40:&SESSION.::NO::P40_ID:'||ID||''', true)
    -- Inc the following comment in your header --
    -- Version 1.0
    -- Last Updated: May 18, 2000
    -- Code maintained at:
    -- http://www.moock.org/webdesign/javascript/
    -- Copy permission granted any use provided this notice is unaltered.
    -- Written by Colin Moock.
    Simon

  • Close popup window

    Hi experts,
    There is a popup window, with two button:
    SAVE
    CANCEL.
    i create the popup in this way:
    lr_popup = lr_window_manager->create_window(
        modal               = abap_true
        window_name         = 'WND_POPUP'
        title               = lv_text
        close_button        = abap_true
        button_kind         = if_wd_window=>co_buttons_yesno
        message_type        = if_wd_window=>CO_MSG_TYPE_NONE
        close_in_any_case   = abap_true
    lr_view_controller = wd_this->wd_get_api( ).
       lr_popup->subscribe_to_button_event(
                       button            = if_wd_window=>co_button_yes
                       button_text       =  'Save'
                       action_name       = 'SAVE'
                       action_view       = lr_view_controller
                       is_default_button = abap_true ).
       lr_popup->subscribe_to_button_event(
                       button            = if_wd_window=>co_button_no
                       button_text       = 'Cancel'
                       action_name       = 'CANCEL'
                       action_view       = lr_view_controller
                       is_default_button = abap_true ).
       lr_popup->open( ).
    My problem is that, if the user press the SAVE button,  then I have to make some checks, and if they don't pass, an error message should be created, and the popup shouldn't close.
    My question is: How can I do that?
    It's ok that if I use the paramter:
    close_in_any_case   = abap_false
    then the popup isn't closed, but how can I close it in the action handler method of the Close button (or the save when the cehcks are fine)
    Thnaks.
    N.

    Hi,
    When there are errors do you want to display them on popup. If there are errors and user closes the window(click on close) button then these errors are shown in parent view rather on popup window.
    Do you want to handle this also..
    In addition to making that close_button as abap_false. there is a method to handle on button close in if_wd_window interface.
    Try to use and write the close window code.
    If you donot want to show the errors in parent view, In the abobe metthod for window close, clear all the messages and then close the window.
    check out this link -
    Re: Form field validation messages in pop-up window
    Regards,
    Lekha.

  • Close popup window and refresh the parent window

    Hello,
    I have a button in a normal report, when clicked opens up an popup window which is a form containing some items and here in this form (i have some editable text items) I make some changes and click on the apply changes button -- this should update the form, close the popup window and should refresh the parent window.
    can anyone please help me out with this issue.
    Thanks,
    Orton

    you have your popup window. When they apply the changes you want it to close the window, right?
    Modify the button (save, apply changes) and give it url redirect to the custom function you create (See below): javascript:saveChanges();
    in the page header, add a new function:
    <script type="text/javascript">
    function saveChanges(){
         doSubmit('SAVE');//this is the line to save the current form on the popup window. (This assumes SAVE is the request value that should udpate the db)
         window.close();//close the popup window
         window.opener.doSubmit('REFRESH');//call doSubmit function on the parent window to cause the page to refresh.
    </script>

  • Don't close popup window on action

    Hello!
    I have a popup window, which contains another window from my component. I assigned actions to buttons. I need not to close popup after action in some cases. I want to decide in action's method. How can I avoid closing the popup?
    Edited by: Konstantin Milutin on Feb 24, 2010 12:55 PM

    Hi,
    when u are creating the pop up window then there is a parameter close_in_any_case set its value as abap_false.

  • Close popup window for swf file

    The captivate movie plays properly in the popup window. The
    "Close Movie" command does not automatically close the popup window
    on some computers. Any sugestions?

    You said, "Some customers?" does it work for other customers?
    Is there a difference between the way two customers are viewing the
    file? Compare the two, and you may get some hints.
    thanks

  • How to Close Popup Window

    Hi All,
    in my main View iam calling a popup window, there i select some values and when i click select button i want to close the popup window.
    Thanks,
    RAju.

    Hi Raju,
    What you can do is while creating the pop window you can take the reference of window manager in some reference attribute of type IF_WD_WINDOW in component controller like.
    wd_comp_controller->gr_window         =
    lr_window_manager->create_window(
                         window_name            = 'Window'
    if_wd_window=>co_msg_display_mode_selected
    *                  close_button           = abap_true
                         button_kind            = if_wd_window=>co_buttons_ok
                         message_type           = if_wd_window=>co_msg_type_none
                         default_button         = if_wd_window=>co_button_ok
    **and now you can call the close method of window at the event you want to close pop up window.
    wd_comp_controller->gr_window->close().
    Regards
    Amol

  • How to close current window  of webdynpro application using webdynpro java

    Hi All,
    u201CTo close the current  window  of webdynpro application"
    if i using exit plug its giving the following error in portal runtime.
    u201Ccom.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Exit-Plug must no be triggered with an URL when running in portal. Use portal navigation instead to navigate to another application! u201C .
    could you send me the  process how to use  portal navigation for the above scenariou2026u2026instead of exitplug.
    Thanks& Regards,
    Srinivas.

    Hi,
    Follow the steps below:
    1. Create a new Window and embed a View which needs to be opened from the main view.
    2. Create a context attribute of type IWDWindow (Java Native Type Option)
    3. Write the following code in the controller for opening the new window:
    IWDWindowInfo windowInfo = (IWDWindowInfo)  
                                                     wdComponentAPI.getComponentInfo().findInWindows("<windowname>");
    IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    wdContext.currentContextElement().set<contextattributename>(window);
    window.show();
    4. In the new window, create a contextattribute and bind it to the attribute created in controller and on action of the close button write the following code:
    IWDWindow window = wdContext.currentContextElement().get<attributename>();
    window.destroyInstance();
    Hope this helps you.
    Regards,
    Poojith MV

  • ESC close Popup-Window

    Hi,
    i have created a popup-window with
      wd_comp_controller->window         = lo_window_manager->create_window_for_cmp_usage(
                         interface_view_name    = 'W_DEFAULT'
                         component_usage_name   = 'XYZ'
                     title                  =
                     close_in_any_case      = abap_true
                         message_display_mode   = if_wd_window=>co_msg_display_mode_selected
      wd_comp_controller->window->open( ).
    Now I have the problem, that the window will be closed if I press ESC.
    Is there a possibility to catch this event.
    Regards,
    Marcus

    Hi ,
    when u press Esc then the method WDDOONCLOSE of the window is called ..
    Regards
    Yash

  • Resizing pop-up window in webdynpro abap

    Hi,
    I am a newbie to abap webdynpro.I would like to know how to resize
    a pop-up window.
    I have used the method 'SET_WINDOW_POSITION'
    from interface 'IF_WD_WINDOW'
    Below seen is my coding, but this is not working. Can anybody  clarify!
    L_FINAL_WINDOW->SET_WINDOW_POSITION(
    LEFT = 200
    TOP = 200
    *position =  ).
    L_FINAL_WINDOW->SET_WINDOW_SIZE(
    WIDTH = '3000px'
    HEIGHT = '3000px' ).
    Regards,
    Sathish kumar

    L_FINAL_WINDOW->SET_WINDOW_POSITION(
    LEFT = 200
    TOP = 200
    L_FINAL_WINDOW->SET_WINDOW_SIZE(
    WIDTH = '30em'
    HEIGHT = '10em' ).
    L_FINAL_WINDOW->open( ).
    also you can use pixels.
    don't use 3000px, use less.
    L_FINAL_WINDOW->set_window_size( width = '300px' height = '' ).

  • Close browser window from webdynpro

    Hi
    Is it possible to close a brower window on click of a button in webdynpro
    Thanks
    Murali

    launch an asp page to accomplish a task.You can use the URL object in Java, this will make the http request to the asp page sharing the browser's cookie (in IE and Moz on windows).
    If the applet needs to make a connection to antother server than the one the applet came from you might be in trouble. You have to sign the applet or the user needs to set up a policy for it.
    Signing your applet:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post
    Posting data:
    http://javaalmanac.com/cgi-bin/search/find.pl?words=url+post

Maybe you are looking for

  • I lost my itunes media folder how can I export the photos from my ipad to another location

    I lost my itunes media folder and also my iPhoto files. I have the majority of the photos from iPhoto library on my iPad. How can I get them from my iPad to another location. Like exporting them to a folder on an external drive.Is this possible. I kn

  • Billing  a Debit Memo to  a Vendor in CRM

    Hi, I am creating a warranty claim document from a service confirmation document in CRM 7.0 Once the claim is approved i am triggering a debit memo doc which can be billed in crm. Now while creating an invoice i am getting few errors as shown below:

  • I have a 1998 bondi blue iMac and I would like to put windows on it help

    So about 7 years ago my school was selling all their 1998 bondi blue iMacs for 50 dollars each. We used it for a tiny bit and then we got a better computer. Anyway I don't have enough money to get a laptop and I just got a desk so I set it up in my r

  • Excel 2013 Border Lines not printing with Windows 8

    Hi. I have a problem with Excel files not printing the border lines of the cells in documents. There are 3 laptops with Windows 8 64bit in our company now using Office 2013. Only today did they mention to me that the borders from only those Laptops a

  • Cannot update 5G iPod setting after 1.2 update...

    Has anyone else run into this problem. I updated to iTunes 7 today along with the 1.2 update for my 5G iPod. I am running Mac OS X. After the update, my video playlists were removed from the iPod. Checking the iPod setting showed that the video playl