Auto close a popup windows in Abap

Dear gurus ,
i use the FM 'POPUP_TO_INFORM' so to display a message .
My scenario is that i want the popup to be closed after 3 seconds automatically without user interaction .
I searched in sdn many times before i post  this question .
Please help if there is a solution .

Hi Dimitris,
I just tried this way and got the output.
What this function POPUP_TO_INFORM is doing is just calling a screen 201 as a subscreen.
So instead of calling this FM, we will call our own subscreen 201, with four input/output fields, say text1, text2, text3, text4 (display only) and ok code, GUI status  and title bar.  (GUI status is not necessary since there wont be user interaction)
(You could also just copy popup_to_inform to a zfunction and make the following changes. I have called a custom screen.  )
data : text1 type char10,
          text2 type char10,
          titl type char20.
data : ok_code type sy-ucomm.
   TEXT1 = 'Text1'.
   TEXT2 = 'Text2'.
   titl = 'Inform'.
  CALL SCREEN 201 STARTING AT 1 3
                   ENDING   AT 80 8.
module STATUS_0201 output.
*  SET PF-STATUS 'PFS'.
  SET TITLEBAR 'TITLE' WITH TITL.
   CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
     EXPORTING
       functioncode           = '=ENT'
     EXCEPTIONS
       function_not_supported = 1
       OTHERS                 = 2.
endmodule.                 " STATUS_0201  OUTPUT
module USER_COMMAND_0201 input.
case ok_code .
*  when 'BACK'.
*    leave to screen 0.
    when 'ENT'.
        wait up to 3 SECONDS.
     leave to screen 0.
  endcase.
endmodule. 

Similar Messages

  • How to close a popup window for system events?

    Hi,
    I have a screen 110 which shows several input field in popup mode.
    The Cancel button can close the screen.
    But my question is how to close the popup window for the following system events?
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close" or "Stop Session"
    The PAI subroutine of the screen has not been triggered for the above system events.
    Thanks for the coming help.
    Best Regards,
    David

    Hi Siddharth,
    I did check with another very experienced ABAP developer.
    The solution was the same as what Arunima Rudra provided.
    And I got a sample program which did work properly.
    The headache is that the system events in my program still cannot be triggered even after I have all the same changes.
    Anyway, I suggest you to try the solution as provided by Arunima Rudra.
    It should work for 2 system events:
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close"
    For "Stop Session", it should not be handled by popup.
    You can observe the same behavior in ALV sorting configuration popup.
    Good luck!
    Regards,
    David

  • HOW TO CLOSE A POPUP WINDOW IN  SELECTION-SCREEN

    Hi,
      My problem is i had created a selection-screen with some field on initial screen and buttons on application tool bar.when i start my selection screen initial screen appears.now when i click a push button on application tool bar an selection-screen appears as window if i close that popup window i am going back to program.but i want to go back to initial screen.

    SET PF-STATUS  '<ZSTATUS>'
    CASE sy-ucomm.
    WHEN 'BACK'.
       LEAVE PROGRAM.
    ENDCASE.
    IT will work.
    regards,
    swarup

  • How to close a popup window in a used component?

    Hi Experts,
    I have two applications in the same project, and they each have one component controller. Let they be component A and B. They have similar functionalities and screens. There is a popup window in A that I would like to use in B instead of creating a new popup window in B, so I added a used component of A in B in order to share the popup window. I am able to click a button in B to get a popup window from A successfully, but I am unable to close the popup window since the event has been created in A.
    Can anyone suggest me how to fix this please? I would really appreciate your help.
    Thanks,
    -Napadol

    Hi,
    You can either use the approach above, which is having an Attribute, type IWDWindow in B's Component Context. When you open the popup you store the reference. When you click close you get that reference back and destroy the window.
    Note, I'd suggest you to have your "View" with no Close Button. Then in Component A you create another View that has an UIViewContainer with your Popup View. You can code the Close code in Component A.
    This way you can do the same and have a code in Component B to close your window.
    Other way would be having it as a Component variable and using the Component Interface on A (create a Method) that goes to Component A and destroy that instance.
    Regards,
    Daniel

  • How to close a Popup window in WebUI

    Hi gurus,
    I created a custom component and launched it in WebUI as a popup. Aside from closing the popup window (via pressing the little "X" on the upper right) or firing the outbound plug 'leave', is there another way to programmatically close the popup? I have several buttons there, all of them must close the popup and resume processing to the calling view. I want to be able to tell which button was pressed with as minimal coding logic as possible.
    Cheers,
    Marc

    Hi Marc,
    You could give your various buttons unique names. You could redefine the do_handle_event method of the impl class. In this you could direct all these events to one event handler itself. In this event handler,if you read the htmlb_event_ex parameter,this contains an attribute called event name.Here,you can distinguish which button has been clicked and then fire your outbound plug while passing a collection with button name in it.
    Regards,
    Sarat

  • Automatically close a popup window?

    I have a javaScript opening a flash video (swf) file in a
    popup window. Is there anyway I can have the window close
    automatically when the flash video gets to the end and stops
    playing?
    here is the code I used below:
    <script language='javascript'>
    <!--
    AUTHOR:WWW.CGISCRIPT.NET.LLC
    URL:
    http://www.cgiscript.net
    Use the code for FREE but leave this message intact
    Download your FREE CGI/Perl Scripts today!
    http://www.cgiscript.net/scripts.htm
    var acePopupWindow=null;
    function acePopup(mypage,myname,w,h,pos,infocus){
    if(pos=='random'){
    LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
    TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=='center'){
    LeftPosition=(screen.width)?(screen.width-w)/2:100;
    TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!='center' && pos!='random') ||
    pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w +
    ',height='+ h + ',top=' + TopPosition +
    ',left=' + LeftPosition +
    ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,d ependent=no';
    acePopupWindow=window.open('',myname,settings);
    if(infocus=='front'){acePopupWindow.focus();acePopupWindow.location='myvid.swf';}
    //-->
    </script>
    The above is in the HEAD of my html, below is in the BODY:
    <a
    href="javascript:acePopup('myvid.swf','acePopup','400','300','center','front');">"I
    started by checking out their website..."</a>

    On myvid.swf you'll need to add actionscript to listen for
    the movie to end, then fire off a javascript command to close the
    window.
    Give the FLV Playback component the instance name vid and
    place this code on the frame that has the component:
    var vidList : Object = new Object();
    vidList.complete = function() {
    getUrl("javascript: close();")
    vid.addEventListener ("complete",vidList);
    stop();
    Here is the tricky part... you need to get the javascript
    function on the html page that pops up:
    <script language=.....>
    function close():
    self.close();
    </script>

  • Close a popup window with a custom button

    Hi All,
    I have two components A and B.
    I will call one of the view of B in A as a pop up
    Component A
    Component B
    as popup
    BTN
    Pressing of BTN which is a custom button created in component B must close the popup screen(Exit Component B).
    I have tryied using Exit outbound plug in the corresponding window of Component B, but still it is not closing.
    Can any one help me to solve this problem?

    OK here is the logic for the second option..
    1. create a node in the component controller of the component B. make it interface node. ( say its name as WIN_NODE)
    2. create an attribute there of type (type ref to IF_WD_WINDOW)   (name as WIN)
    3. create the same node in the view where you have the close button (custom close button). map it to the component controller
          node.
    then the same node will be present in the interface controller
            view                         component controller                      interface controller
          WIN_NODE-->WIN_NODE--
    >WIN_NODE
              WIN-->WIN--
    >WIN
    now go to the component A,
    there you must have declared component B as the used component.
    4.go the view which fires the window creation .
    5. there go to the properties tab and add the interface controller or Component B as used controller.
    6. After that go to context tab and create a node WIN_node having attribute WIN there also.
    7. Map it to the node of interface controller of component B.
    8. Now the coding part.
    a.)   in the component A which fires the event of opening the window, write the following code in the event handler.
    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_for_cmp_usage(
                       interface_view_name    = 'WIN2'
                       component_usage_name   = 'TEST'
    *                  title                  =
                       close_in_any_case      = abap_true
                       message_display_mode   = if_wd_window=>co_msg_display_mode_selected
      DATA lo_nd_win_node TYPE REF TO if_wd_context_node.
      DATA lo_el_win_node TYPE REF TO if_wd_context_element.
      DATA ls_win_node TYPE wd_this->element_win_node.
      DATA lv_win LIKE ls_win_node-win.
    * navigate from <CONTEXT> to <WIN_NODE> via lead selection
      lo_nd_win_node = wd_context->get_child_node( name = wd_this->wdctx_win_node ).
    * get single attribute
      lo_nd_win_node->set_attribute(
        EXPORTING
          name =  `WIN`
          value = lo_window ).
    lo_window->open( ).
    you might be already having the code for opening and creating the window add the logic for passing the window instance to
    context there as shown above.
    b) in the context B fetch the window instance in the eventhandler of the close button and close it.
    DATA lo_nd_win_node TYPE REF TO if_wd_context_node.
        DATA lo_el_win_node TYPE REF TO if_wd_context_element.
        DATA ls_win_node TYPE wd_this->element_win_node.
        DATA lv_win LIKE ls_win_node-win.
    *   navigate from <CONTEXT> to <WIN_NODE> via lead selection
        lo_nd_win_node = wd_context->get_child_node( name = wd_this->wdctx_win_node ).
    *   get element via lead selection
        lo_el_win_node = lo_nd_win_node->get_element(  ).
    *   get single attribute
        lo_el_win_node->get_attribute(
          EXPORTING
            name =  `WIN`
          IMPORTING
            value = lv_win ).
    lv_win->close( ).
    thanks
    Sarbjeet singh

  • Close Document Viewer window through ABAP program

    Hi Experts,
    I have requirement is
    to close opened Document Viewer window (Txn : SDV) through ABAP report
    If anybody worked on this please help me  regarding this.
    Thanks and Regards,
    Shivanand Kalagii

    easy one
    call method CL_DV_SDV=>GET_SINGLETON in order to get the current instance of Document Viewer
    then call method CLOSE_WINDOW of this instance

  • Auto-close print queue windows after my job finishes?

    Whenever I print something, a window for the printer opens up showing me the current print queue. That's great. What's not-so-great is me having to keep on closing those windows after they open.
    Is there a way for those windows to close themselves after my print job finishes?
    Thanks.

    Thanks! (I haven't actually tested it yet, but I did bring the printer up in the dock and set the "Auto-Quit" function, so it at least seems plausible that it will work.)
    Perhaps a new low in Apple UI design: an option -only- accessible via a Dock Menu?

  • Finding Screen Number for a Popup Window using ABAP debug

    Hi Guys
    IPlease could you tell me how to find the screen number of a pop-up window using debug as opposed to F1 Help?
    Thanks
    Edited by: Brett Cunliffe on Sep 14, 2011 9:37 PM

    Hi,
    You can create a short cut for debugging on desktop and drag n drop the debugging icon from desktop to pop up screen, then it will be available for debugging.
    or copy the below code in a notepad and save it. If you want to debug pop ups then drag and drop this file.
    The code is
    [FUNCTION]
    Command=/H
    Title=Debugger
    Type=SystemCommand
    [more info wiki|http://wiki.sdn.sap.com/wiki/display/ABAP/SAPGUI+shortcuts]
    Shiva

  • Auto-close "Downloads List" window?

    Is there a way for the "Download List" window to automatically close when a download is complete? I have it set so that items are automatically cleared from the window when the download is complete, but would like the window to close as well rather than just sitting there empty. (Disabling it altogether might be OK too, I find with a fast connection most of the things I download might only take a second or two, so there's no need to really monitor their progress).

    I don't think you can turn this window off.
    One alternate use for the window aside from monitoring downloads is that if you click on the magnifying glass icon next to the item's name, you can have it revealed in the Finder. Handy if you don't want to bother clicking to find the item, Safari/the Finder will take you right to it!
    (of course to use this feature you would have to change preferences so that the window wasn't cleared automatically.)
    -chuck

  • 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

  • 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 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>

  • 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

Maybe you are looking for

  • Help in creation of XML file for IDOC postings

    Hi All, Need help if anyone has knowledge/experience in creating XML files for IDOC processing. We need to design an input file (in XML format) for creation of IDOCu2019s for purchase Invoices through Interface. We have an existing input file, which

  • Connect in database default  wiht SQL PLUS

    Hi How can I to connect in database default , using SQL PLUS ? And after I may change conexion with ACCEPT and change PROMPT ?

  • Is it still possible to download photoshop/bridge cs2

    I recently had my 8 year old iMac repaired and now I can't use photoshop cs2 as adobe seems to think it is not registered. I've tried reloading from my original photoshop install c.d.'s but can't get the validation to work. It seems best if I could d

  • Can't locate serial number for digital download

    Where can I find a product serial number for a digital download? I purchased Photoshop elements bundled with my Dell laptop. I'm able to initiate download but never received a serial number and can't locate one in the invoice or other communication r

  • Can't install 10.9 because of Time Machine

    I had a bootable drive selected for Time Machine, then decided I wanted to install 10.9 on it (it has 10.8.6 now). The Mavericks installer says it's a TimeMachine backup EVEN AFTER I deselect it as a TimeMachine drive and turn Time Machine off (it al