Close window in web dynpro abap

Hi,
I have a web dynpro application for a workflow. When a user clicks on the workitem in UWL, a window opens with task description and two button on it. When the user clicks on one of the button, my requirement is: I want to close that window. How could I achieve that? any snippets of code will be highly appreciated.
Thanks.
Bijay

Hi
I am facing problem with 2 buttons one is SAVE and One is Close.
For Close Button i have added below code its giving the popup with yes and no buttons, Its closing when i press Yes but its giving error like " Application terminated you can close the window " , Please help how can i sove this one.
Sorry to disturb you.. Thanks in advance.
  data : l_view_cntr type ref to if_wd_view_controller,
l_win_cntr type ref to if_wd_window_controller,
l_window type ref to if_wd_window,
l_parameter_list type wdr_event_parameter_list,
l_parameter type wdr_event_parameter,
l_val type ref to data.
field-symbols <fs> type any.
l_view_cntr = wd_this->wd_get_api( ).
l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
l_parameter-name = 'CLOSE_WINDOW'.
create data l_val type c.
assign l_val->* to <fs>.
<fs> = 'X'.
l_parameter-value = l_val.
insert l_parameter into table l_parameter_list.
l_win_cntr->if_wd_view_controller~fire_plug(
exporting plug_name = 'EXIT'
parameters = l_parameter_list ).
For Save button...
I wrote below code in component controller method , but its not populating any window or any pop-up please help in this also.
  DATA:
        lo_cmp_api        TYPE REF TO if_wd_component,
        lo_window_manager TYPE REF TO if_wd_window_manager,
        popup_title       TYPE string.
       wdw_variant       TYPE string VALUE 'WDW_TEMPLATE_POPUP'.
  CALL METHOD cl_wd_utilities=>get_otr_text_by_alias
    EXPORTING
      alias      = 'PAOC_HAP_PA_CASC_GOALS_UI/TEMPLATE'
    RECEIVING
      alias_text = popup_title.
Calling the POPUP
  lo_cmp_api = wd_this->wd_get_api( ).
  lo_window_manager = lo_cmp_api->get_window_manager( ).
  CALL METHOD lo_window_manager->create_window
    EXPORTING
      window_name       = 'ZH_GOALS'
      title             = popup_title
      close_button      = abap_true
      close_in_any_case = abap_false
      button_kind       = if_wd_window=>co_buttons_okcancel
      default_button    = if_wd_window=>co_button_ok
    RECEIVING
      window            = wd_this->lo_window.
  wd_this->lo_window->open( ).

Similar Messages

  • Opening External Window in Web Dynpro ABAP with URL disabled or Hidden

    Hi Experts, I have a requirement where-in we want to open the Web Dynpro ABAP application using tcode WDYID (by passing the application name  and startmode), but the URL of the newly opened explorer should be disabled or hidden. To achieve the same, I have created a component (lets name it PARENT) and inside that in DOMODIFY/DOINIT method have written code to invoke the required WDA (lets name it CHILD) in external window (by using lo_window_manager->CREATE_EXTERNAL_WINDOW) and is successfully able to open the application with URL disable using different parameter of method CREATE_EXTERNAL_WINDOW. But in this case there are 2 window which opens, one is for PARENT view and other is for CHILD. Now I only want to keep the second view (CHILD) to be opened and want to close the PARENT view. When I used EXIT_PLUG to close the PARENT window, it closes both the window. Need your inputs on my approach or if you have any. Regards, Harish

    Hi,
    If you open the popup, it opens as Modal Window, originating from Parent window. Without external window( where you can pass has_location = abap_false ), you cannot hide the URL/Address bar.
    If you want to partially hide the URL( if you dont want to show the full URL with application path), you can create an Alias for the service in SICF.
    Go to SICF, and create an alias for your WDA application; say original URL: domain:port/sap/bc/webdynpro/sap/<ZAPPLICATION_NAME>
    This URL you can convert( partially hide) as, domain:port/sap/<ANY_NAME>
    Refer creating Alias in this help: http://help.sap.com/saphelp_sem320bw/helpdata/en/55/361a3c9c004866e10000000a11402f/content.htm
    Hope this helps u,
    Regards,
    Kiran

  • Closing web browser from a Web Dynpro (ABAP) component in it

    Hi,
    I am opening a Web Dynpro component in IE.
    I have a requirement to close the Internet Explorer window on click of a "Close" Button in Web Dynpro (ABAP) component. I am using EXIT Outbound plug of the Main Window to perform the same.
    In the EXIT plug I am setting "CLOSE_WINDOW" parameter to ABAP_TRUE.
    On click of the "Close" button a pop-up dialog box (with "Yes" and "No" buttons) appears asking me whether I really want to close the IE window.
    If I click on "Yes" button of the dialog box, the IE window gets closed without any issues.
    But when I click on "No" button, the IE window shows up a blank screen. I want the control to come back to the calling Web Dynpro component's screen.
    Appreciate any help/guidance in the above issue.
    Thanks,
    Prasanna

    create an action 'YES','NO', 'CANCEL' in required view.
    copy and paste below code in YES action
    method ONACTIONYES .
      data : l_view_cntr type ref to if_wd_view_controller,
    l_win_cntr type ref to if_wd_window_controller,
    l_window type ref to if_wd_window,
    l_parameter_list type wdr_event_parameter_list,
    l_parameter type wdr_event_parameter,
    l_val type ref to data.
    field-symbols <fs> type any.
    l_view_cntr = wd_this->wd_get_api( ).
    l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
    l_parameter-name = 'CLOSE_WINDOW'."'CLOSE_WINDOW'.
    create data l_val type c.
    assign l_val->* to <fs>.
    <fs> = 'X'.
    l_parameter-value = l_val.
    insert l_parameter into table l_parameter_list.
    l_win_cntr->if_wd_view_controller~fire_plug(
    exporting plug_name = 'EXIT_PLUG'
    parameters = l_parameter_list ).
    endmethod.
    goto your window
    create plug EXIT in Window of type EXIT and chect interface checkbox
    create a button - for example - "PUSH BUTTON"
    in pushbutton action
    copy and paste this code
    method ONACTIONEXIT_PLG .
    DATA: API TYPE REF TO IF_WD_COMPONENT,
          WINMAN TYPE REF TO IF_WD_WINDOW_MANAGER,
          WIN TYPE REF TO IF_WD_WINDOW,
          TEXT1 TYPE STRING_TABLE,
          ls_text type string,
          V_API TYPE REF TO IF_WD_VIEW_CONTROLLER.
    API = WD_COMP_CONTROLLER->WD_GET_API( ).
    WINMAN = API->GET_WINDOW_MANAGER( ).
    LS_TEXT = 'Do You Want To Close the Window'.
    INSERT LS_tEXT into table text1.
    win = winman->create_popup_to_confirm(
                                           window_title = 'CONFIRM'
                                           text = text1
                                           button_kind = if_wd_window=>co_buttons_yesnocancel
                                           message_type = if_wd_window=>co_msg_type_question
                                           window_position = if_wd_window=>co_center ).
    V_API = WD_THIS->WD_GET_API( ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
            ACTION_NAME = 'YES'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_TRUE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
            ACTION_NAME = 'NO'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL
            ACTION_NAME = 'CANCEL'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->OPEN( ).
    endmethod.

  • Event handling for closing a browser window on portal in web dynpro abap

    Hi,
    I am new to portal as well as web dynpro. Is it possible to handle portal events in web dynpro abap? My requirement is whenever a browser window is closed on portal, if any new system messge has been added I want to display them in a pop-up. I checked examples from the package 'SWDP_TEST' but they trigger events in web dynpro and pass them to portal. I want to subscribe to the close event of portal and handle it in my web dynpro abap application. How can I achieve this? Please suggest.
    Thanks and regards,
    Amrutha

    Amrutha S wrote:
    Is it possible to handle portal events in web dynpro abap? My requirement is whenever a browser window is closed on portal, if any new system messge has been added I want to display them in a pop-up. I checked examples from the package 'SWDP_TEST' but they trigger events in web dynpro and pass them to portal. I want to subscribe to the close event of portal and handle it in my web dynpro abap application. How can I achieve this? Please suggest.
    Hi,
    I dont think that you can code to close IE browser window as you cannot access MS IE APIs in WD ABAP. I looked into closing IE browser and got http://p2p.wrox.com/general-net/16588-handling-ie-close-event.html . reading this, it seems the coding can be done in C#(asp) etc.
    also refer Closing of IE window
    I hope this is useful for you.
    Thanks,
    Chandra

  • Window Navigation In Web Dynpro ABAP

    In one of our requirements we would have to make use of the suspend plug in Web Dynpro Abap. Would anyone happen to have any other information on this topic. Is there a sample program available which demonstrates the same?
    The requirement is that, I have to call an external window (output screen) from my present screen (input screen). While this external window is active, the calling window (input screen) should be disabled. When the external window (output screen) is closed the input screen should be enabled again. I have read that suspend/resume plugs can be used for this. However, I have not been able to figure out how to use them.
    As a starting point, it would help if I can find out how navigation between two windows (not views) can be achieved.

    You can enable and disable a view at least programmatically by binding the enabled property of all elements to one context variable and setting this to false when you navigate and back to true when you come back.
    With these special plugs I haven't worked at time.
    Frank

  • Problem in calling abap editor with the program name in Web Dynpro ABAP

    Hi,
    I have to caal ABAP Editor screen with the display of program after clicking a button from web dynpro abap application.
    I am able to call the ABAP Editor initial screen, but i want the editor display screen with a program.
    How to do that?
    Please find my code below:
      DATA : FINAL_URL TYPE STRING,
             URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
    DATA V_TCODE TYPE TCODE.
      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.
      DATA:  LD_URL TYPE STRING.
    V_TCODE = 'SE38'.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
      '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?sap-client=&transaction=' V_TCODE '&OKCODE=SHOW'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Now, how to pass my Zprogram name into the URL.
    I need to get the editor screen with the display of the program.
    Thanks,
    Radhika

    Hi Kiran,
    Please find my code below:
    DATA :   URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
      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.
      DATA:  LD_URL TYPE STRING.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
    '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?&transaction=se38&RS38M-PROGRAMM=Y2PSOLTREE&~okcode=shop'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Here,, Y2PSOLTREE is the program, that should show in SE38 screen.
    I used the above code, but still it is showing the SE38 initial screen.
    Thanks,
    Radhika

  • Closing window of web dynpro application with exit-plug don't run in the EP

    Hi everybody,
    I want to close a window that contains a Web Dynpro with a close button, because it's used and create as a popup from an other iView (that's not created with web dynpros) in the EP. I read the different threads how to close a window in web dynpro, like JavaScript in WD
    I create a HTML file with the javascript code to close the window and it works fine, when I start the application separately.
    If I used it in the portal and click the close button I get the following error message:
    com.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!
    I tried also: ...wdFirePlugExit("javascript:self.parent.close();") or some other javascript code, but got the same error message.
    Then I tried:
    WDPortalNavigation.navigateAbsolute(url,WDPortalNavigationMode.SHOW_INPLACE,(String) null, (String) null,(String) null);
    instead of fireing the outbound plug in the action of the close button
    (...InterfaceViewController().wdFirePlugExit(url);)
    but than a new window with the EP open and the old is still there!
    We use the NWDS2004s an the EP 7.00.
    It must be possible to close a (this) window!
    Thanks for any hint
    christian

    Hi,
       This is what you can do:
    1. You have already created the HTML file with the necessary javascript in the foloowing folder structure :
    src->Mimes->Components-><your component name>-><fileName.html>.
    2. Create a new iView of type URL in your portal.
    3. Get the absolute URL of this HTML file inside your project. This will be in the following format:
    http://<server>:<port>/webdynpro/resources/sap.com/<development ComponentName>/Components/<namespace>/<fileName>.html
    You can find it thus:
    try {
    String u = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"filename.html");
    wdComponentAPI.getMessageManager().reportSuccess(u);
    } catch (WDURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    4. Now enter this URL string as the URL for the iview.
    5. Do a normal portal navigation to this iview on-click of the button.
    Regards,
    Satyajit.

  • Sequencing Problem in Web Dynpro ABAP

    Hi Web Dynpro (ABAP) Guru's,
    Can anyone tell me how to read a parameter from the WDA url in my view? The situation is like this: My WDA is being rendered in the Portal EP 6.0 as an iView. When my WDA is called the portal also appends in the URL the plant number. I want to grab that plant number and use it in my view to show some default data.
    As per other weblogs/forum posts I defined a parameter "PLANT_NO" in the "Default" startup plug of my Main window. I'm using the Get_Data method to read this parameter in the plug. I'm able to read the URL parameter here and so far it is good. Read below for the problem..
    If I understand the order of operations correctly, doesn't the views get created, then the default plug code is run, then the views are placed on the window and then shown to the user. Since my views are created before my default plug is run I DO NOT get the URL parameter value in the WDDOINIT of my view. When I debug the application, the WDDOINIT of the embedded view gets called before the Default startup plug. Am I missing something here?
    If someone can tell how to read the URL parameter in the WDDOINIT (instead of Default Startup) of the view I could default in the data I want to display. OR any other suggestions to get past this problem would be appreciated.
    Does this make any sense and does anybody have an idea of where I could find some info about how to do this?
    Thanks much for your help. Points will be awarded.

    Thanks Klaus for the response.
    I don't want to read the parameter from the default plug, but need to access the URL parameter and display default data in my view. Let me explain the scenario:
    My Web dynpro application is called from the Portal. The Plant number is passed in the URL as:
    http://...../sap/bc/../../<Web Dynpro Application name>?PLANT_NO=0012
    I want to show Material Stock values in the view for Plant "0012". To access this value I've defined a parameter with same name (PLANT_NO) in the default startup plug of my main window. I get access to the URL parameter through this plug parameter.
    I have only ONE view embedded in this window where the Stock values are selected from table MARD for the specified plant. I want to get the plant value from URL in my WDDOINIT method to make this selection from database. I'm then binding the results to the view table UI element. My problem is that the URL parameter is read in the Default plug, but the data selection and view binding happens before in the WDDOINIT method where I don't know the plant.
    Again, I don't want to read the plug parameter, but I want to get the URL parameter (PLANT_NO) and then render the view based on the data selected for this parameter. Please let me know how this can be achieved by reading the URL parameter in WDDOINIT method (Constructor) so that it can be used subsequently in the application.
    Thanks for your help and looking for a resolution.....

  • ALV object in Web dynpro ABAP

    Hi All,
    I want to include ALV object in web dynpro ABAP, instead of a table in a window. I have SAP Version 4.6 as backend.
    Pl help.

    Hi Nirmal,
    the information on ALV and WDA is here: http://help.sap.com/saphelp_nw2004s/helpdata/en/74/fd4142646ab46be10000000a155106/frameset.htm
    As you know, Web Dynpro ABAP is availiable with NW2004s, not before.
    Regards, Heidi

  • Web dynpro abap or java ?

    Hi All,
          Our client wants a web front end for the SAP system and has asked us to search which web dynpro ABAP or Java will be suitale ?
          They were of the opinion that web dynpro for ABAP is not that good for web interfaces is it correct ?Also is there demend for web dynpro developers in the market ?
    Thanks & Regards
    Gaurav Jain

    >They were of the opinion that web dynpro for ABAP is not that good for web interfaces is it correct ?
    What do you mean by Web Interfaces?  Web Dynpro ABAP and Java are well suited for created browser-based (or rich client based) business application User Interfaces.  If by Web Interfaces you mean Internet facing, highly customizable user interfaces - then no - neither web dynpro abap or java are really well suited for that situation.  WDA and WDJ are both designed to create consistent Business Application user interfaces.
    Now if you just want to compare WDA and WDJ - that is a very different question. The differences in capabilities are relatively minor. Generally it comes down to which programming language you have more of a skill set in and how close to the underlying data you need to be.  Also are you planning to extend existing SAP applications?  WDA is primarily used by SAP within the Business Suite (ERP, SRM, PLM, etc) - two exceptions however - WDJ is used in ESS/MSS (although newer portions of that solution are in WDA) and CRM uses BSP/CRMUI.  WDJ is used by the middleware components (Portal) and edge or composite applications.

  • How to create  calendar in web dynpro abap

    Hi ,
    how to create  calendra in web dynpro abap.
    Thanks in advance.
    Regards, Chetan

    hi,
    For calender control, there is Date Navigator under "complex tab". You can just click and drag it and provide calender control.
    One more easy way is to create a input field. In the context, create a node and attribute of type "D"(which means DATE). And bind the context to your input field under "values" in property window. While running the program, you will see an calender attached to lt on the input field.
    Regards,
    Jithin

  • How to display the data of CJ2C(T-CODE) using web dynpro abap

    Hi all:
        How to display the data of CJ2C(T-CODE) using web dynpro abap.
        CJ2C used to display a Gantt Chart.
        Thanks.

    Hi,
    Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.
    On action place the code and Deploy the application
    byte[] bytes = new byte[ 1024];
    FileOutputStream out = new FileOutputStream( new File( <path in server>));
    InputStream in = resource.read( true);
    int len;
    while( ( len = in.read( bytes)) > 0)
         out.write( bytes, 0, len);
    in.close();
    out.close();
    Regards
         Vinod V

  • Web Dynpro ABAP application  - Fully Qualified Domain Names (FQDN) error

    I have created a Web Dynpro ABAP application. On executing it, I get Fully Qualified Domain Names (FQDN) error. I have host name of my server.
    I do not know domain name of my server. How can I detect it?
    I want to know in  Windows XP and Windows 7.
    Please help me asap.

    Hi,
    On your server run command ipconfig /all
    FQDN = Hostname + Primary DNS Suffix
    The make sure the profile parameters SAPLOCALHOSTFULL and icm/host_name_full reflect the same.
    Regards,
    Srikishan

  • Web Dynpro ABAP : Parameter ,start plug and WDDOINIT

    Hi,
    I'm currently developing a web dynpro abap application which receieves parameters(Work item id).
    I can read the content of paramaters in the method start plug of the window and I can store them in the context.
    What I want to do is, in the method WDDOINIT of my main view, I want to read the parameter Work item id
    The problem is that the WDDOINIT  is called after the start plug, So the context is still empty.
    I have tried to read the context in the WDDOMODIFY view. There the context is correctly filled but apparently, we can not navigate to another view from the WDDOMODIFY .
    Is this normal?
    Thanks for your answer

    I did find a solution and I wanted to share and validate it.
    - I created a event in the COMPONENTCONTROLLER "event_chk_url_params".
    - In the view where I use these url parameters, I created a method (event handler) for the above event that checks for the url parameters and fires plugs based on the value of the url parameters.
    - From the window's handle default method, where I get all the url parameters, I raise the event in the component controller ... which inturn calls the event handler in the view, which in turn redirects.
    Is this the right solution or is there something better then this?

  • Web Dynpro ABAP: Inbound/Outbound plugs

    Hi,
    Has anyone used the suspend/resume functionality in a Web Dynpro ABAP Window? I need to navigate from my component to another component and be able to navigate back and resume the session. Apparently it can be done using these types of plugs but there is no doco/examples available to look at.
    Thanks!!
    Nick

    Hi Nick,
    here's documentation about the suspend/resume plugs: http://help.sap.com/saphelp_nw04s/helpdata/en/43/6b972329d23d33e10000000a11466f/frameset.htm
    Regards, Heidi

Maybe you are looking for

  • How to convert bits into a character

    The code which i could get from this forum is specified below which converts a String into Bits.......i could successfully use this code in BitStuffing method for client side.....at server side i need to convert these bits into characters again......

  • Music found, but not being read

    So i was on a plane when my ipod started acting up just skipping songs. So I reset it. Though when I did that it showed all my songs were gone. Though the space for the songs is still there. i then found the files looking on my computer. how can I ge

  • How do I cause a link to forward to a different one

    I believe I started a thread on this forum last year where someone told me that it is possible to enter html code that causes a web page to redirect to a new web page. For example, I can get www.mysite.com to forward to www.mysite.com/page1. Can anyo

  • My phone is linked to orange how to i get an unlock code

    Hi - I've got an iPhone4 which is locked to orange, orange say they won't get me an unlock code as the phone isn't linked to my account [ I bought it off ebay ]. Can I get the network unlock code from Apple or do I have to go to some dodgy backstreet

  • How long is my warranty for my iphone 4s? Model MD276LL/A

    How long is my warranty for my iphone4s? model MD276LL/A