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.

Similar Messages

  • Closing Web Browser from an Applet

    Does anyone knows how to close the Web Browser from an Applet ?
    Also Is there a way to close a browser which is intantiated from using ApplteContext ().showDocument ("....","_Blank").
    Thanks
    Sohan

    Hi kavinjir!
    Using class netscape.javascript.JSObject is possible to interact with javascript which can easily close the window browser but I'm afraid about the newest one because it isn't a child window. If this newest window contains an applet both (applets) can interact and send/receive "messages" to trigger an event (e.g; close via javascript again).
    Best Regards.

  • Xmonad - prevent web browser from going "fullscreen"

    Hi,
    is there a possibility in xmonad to prevent an application (in my case the web browser) from resizing to fullscreen when it's the only window on a workspace? I have a huge display and do not want chromium to resize to the full resolution. I've done a lot of searching on this problem (and I can't believe that I'm the only one with this issue) but didn't find anything about that. Maybe because of my bad English...
    As mentioned in the title, the WM is xmonad.
    Thank you very much.

    Well, you could write a manageHook that tests if it is the only window on the screen, and if it is, changes the layout, or floats the browser with a spesific size

  • Is it possible to start a web browser from with xterm (X11)?

    Hello,
    Would it be possible to start a web browser from xterm? I am able to use for example, dbca or netca. But I want to know if I could start a web brower in my xterm. Thank you.

    Thank you. Firefox was not found on this redhat linux, I am guessing it was not installed. I did a find / -name firefox but not finding it. I don't think the SA installed GUI on this box. Is there a browser I can use even though GUI was not installed? That is why I am attempting to use xterm hoping to be able to access a brower in xterm. I am using Xming for xterm. Is there something in Xming I can use so I can access the Oracle Database Control Console? I can use firefox from my desktop but the port is block at the firewall and the SA would not open the port due to security reasons. Thank you.

  • Can open a Web browser from the worksapce?

    Hi,
    we are using Adobe livecycle ES2.5, We are trying to add an action to our users to open a specific URL in a Web browser, is it doable?
    Thanks
    Hussam

    Thanks Nith,
    we did this before when using pdfs but in our case we are using Flex and we do not want to call the web browser from the flex we need it from the workspace directly,
    please see the attachment, when the user clicks complete we want to open the browser instead of submitting the form to the next step.
    any idea?
    Regards

  • How to open a web browser from java

    Hi
    Would anybody please help me with this. I need to open a web browser from my java app but I don't know. What method I can use?
    Thanks.
    Hung.

    You can use the Runtime class for this. It can run any command. So, you can run the .exe file of your Web browser.
    The following code will run Internet Explorer (assuming iexplorer.exe is in C:\Program Files\Internet Explorer):
    import java.lang.Runtime;
    public class Explore{
    public static void main(String[] args) {
    try{
    Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore");
    }catch (Exception e) {
    System.out.println("Exception: " + e);

  • Launch a default web browser from my java application

    Hello,
    I have been trying to launch my default web browser from my java application, but am unable do it. Right now, I am using ---- "Runtime.getRuntime().exec("cmd /c start <url>"); to launch my webbrowser. It launches the browser but displays the command prompt for a second or so, and then replaces my already existing page with the new url.
    Is there any way for me to launch the url in a completely new browser each and every time. And I don't want the command prompt to show up for a sec. Please help...!
    Thanks in advance.
    -BusyBusyBee

    If by any chance your application is an Applet, you can use this to open a new browser window:
    getAppletContext().showDocument(new URL(theUrl), "_blank");
    But, you probably would have specified if that were the case. Oh well. Hope it helps someone!
    -sheepy.

  • Any new ideas for launching web browser from application

    I have searched the forums trying to find a new way of launching a web browser from a java application. The problem I am having is that on Unix and Linux systems, at least the variety I have access to (not quite sure on what that variety those are as they are not my systems or systems I control), the common method of using Runtime.getRuntime().exec(STRING) with either netscape or mozilla does not work. While using the Runtime.exec method is not the same as a console, I did try on these systems "netscape + A_WEB_ADDRESS" (or mozilla) and it did launch the respective browser with the page, so it appears that at least from the console level, those commands are valid.
    All the forums seem to say that the Runtime.exec method is the way to go. All the source code I have found through links from the forum say the same thing. I have voted on this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4210168.html
    and the feedback there does seem to indicate that there is similar trouble out there. Below is the code I am using. It does work on Win2000,XP, and Mac OSX. The application is not supported on earlier systems, and as it stands it will not work on Win 95,98, nor ME. Only small modification should be needed for work on those OSs, but as I no longer personally use those OSs, I cannot be sure.
    private void openNativeBrowser(String url) {
    // not the browser itself is started, i only call something like
    // start http://www.javasoft.com
    // and then the standardbrowser will be started ...
    StringBuffer call = new StringBuffer();
    System.err.println(System.getProperty("os.name"));
    System.err.println(System.getProperty("user.dir"));
    try {
    // which OS ?
    String operatingSystem = System.getProperty("os.name");
    // how to call the OS
    if (operatingSystem.toLowerCase().indexOf("windows") > -1)
    call.append("cmd /c start ").append(url);
    else
    if (operatingSystem.toLowerCase().indexOf("mac") > -1)
    call.append("open ").append(url + " &");
    else if(operatingSystem.toLowerCase().indexOf("linux") > -1)
    // use Script 'netscape'
    call.append("mozilla ").append(url).append(" &");
    else
    call.append("netscape ").append(url).append(" &");
    System.err.println(call.toString());
    // start it ...
    Runtime.getRuntime().exec(call.toString());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    As I said, if you have a new way to call the broswer that seems to work on either Unix or Linux, please post it, point to it, or explain it.
    Aaron

    there is a shell script on Linux called htmlview that you can launch like this:
    String[] cmd = {"htmlview", "http://java.sun.com"};
    try {
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ioe) {
        // do something
    }which will open the default browser. Don't think this is available on other *NIX though, although the script itself would probably work so you could include it with your app (/usr/bin/htmlview).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Capture an image using the web camera from a web application

    Hi All,
    Could anyone please share the steps what have to be followed for capture an image using the web camera from a web application.
    I have a similar requirement like this,
    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.
    3) Upload the Image to the server from the temporary location.
    Please share the details like, what can be used and how it can be used etc...
    Thanks,
    Suman

    1) Detect the Webcam on the users machine from the web application.(To be more clear when the user clicks on 'Add Photo' tool from the web application)There's not really any good way to do this with JMF. You'd have to somehow create a JMF web-start application that will install the native JMF binaries, and then kick off the capture device scanning code from the application, and then scan through the list of devices found to get the MediaLocator of the web cam.
    2) When the user confirms to save, save the Image in users machine at some temporary location with some unique file name.You'd probably be displaying a "preview" window and then you'd just want to capture the image. There are a handful of ways you could capture the image, but it really depends on your situation.
    3) Upload the Image to the server from the temporary location.You can find out how to do this on google.
    All things told, this application is probably more suited to be a FMJ (Freedom for Media in Java) application than a JMF application. JMF relies on native code to capture from the web cams, whereas FMJ does not.
    Alternately, you might want to look into Adobe Flex for this particular application.

  • Invoking one web service from another web service

    Hi there,
    I want to invoke a web service lets say X. But befor sending parameters to this web service, what i want to do is first pass the parameters to a web service called Y and Y will decide wether to call X or not. In other words i want to invoke a web service from another web service.
    Its kind of urget so do the needful asap.
    Thanks

    Calling another webservice from within a webservice does not require anything special. The service (say svc1) that calls another service (svc2) will be a web svc client. So you will have to do the same steps for svc1 as you would do for any other web service client

  • Consume a Web Service from a Web Page

    I had tried out the Tutorial "Consume a Web Service from a Web Page". I have encountered this error :
    ; nested exception is: java.lang.NullPointerException.
    oracle.adf.model.adapter.AdapterException: DCA-40010: The Web Service call failed. The service returned a SOAP fault with the message: [S:Receiver] EJB Exception: : java.lang.NullPointerException
         at oracle.model.freightjb.CalculateFreightBean.calculateFreightCost(CalculateFreightBean.java:23)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy170.calculateFreightCost(Unknown Source)
         at oracle.model.freightjb.CalculateFreight_5vfuh6_WSOImpl.__WL_calculateFreightCost_WS(CalculateFreight_5vfuh6_WSOImpl.java:72)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    I tried to modify abit the code as i changed the web method parameter from object (BatchOrder order) to variables(eg. int) and it works. When I test the Web Services I need to select the include checkbox den it works nicely else i will also encounter this problem. Does this mean the web services can not take it object as parameter?

    Hi Paolo,
    maybe I faced the same issue. I solved it reading the thread:
    web service deployable client
    Hope this help
    Cheers
    Roberto

  • Start Web Browser from ABAP in WINGUI with SSO

    Hi,
    I'm using WINGUI 6.20 patch 47. I need to start a separate web browser to display a BSP.
    The difficulty is that we want single sign on to work. We have the portal set up for authentication and our instance is set up to create and accept logon tickets.
    We've tried to use the html viewer control but I think this only works within the html gui ?
    We've tried the CALL_BROWSER function but it doesn't seem to pass along the logon ticket.
    Is there a way to do this ?
    Thanks for your help.
    Thierry Dagnino
    Systems Architect
    Hydro-Quebec

    Hi Thomas,
    the suggested solution works at 90 %.
    The BSP we display in the html control calls another bsp in a popup window.
    The popup requests the login again. I think this is because the popup starts a new Internet Explorer browser which has no session state.
    The strange thing is that if I first start a browser and authenticate to the server and then run the function which displays the bsp in the html viewer, it works great. I think it uses the logon ticket that the browser received.
    Everything else works but we can't use it if popups don't work since CRM 4.0 uses a lot of them.
    Also, if we use the show_url_in_browser function, it works. The problem is we have a useless window displayed. Is there a way to close this window immediately after the show_url_in_browser method is called ?
    Thanks.
    Message was edited by: Thierry Dagnino

  • How to open a web browser from an windows phone app

    Hi everyone,
    I am pretty new to Windows Phone 7, and now what I am trying to do is to create a simple app. When a user click to start this app, a browser will open and show the content of a webpage from a specific address.
    I tried to use a webbrowser object, but it seems like that doesn't sport cookies. So I need my app to open a real web browser (maybe IE mobile) to do the job.
    Thank you.

    copying from stackoverflow: "If you want to embed a browser window inside your application then use  the WebBrowser control.  Add an instance of the WebBrowser control to  your form then you can reference it in code using the name you
    give  it.  (Default name is "webBrowser1")"
    Microsoft MVP J# 2004-2010, Borland Spirit of Delphi 2001

  • Open web browser from java application to specific page

    Hi,
    I used the code from http://www.javaworld.com/javaworld/javatips/jw-javatip66.html to open a web browser to a specific URL. That worked great! However, I run into a problem if the URL targets a specific page, for example, "http://www.yahoo.com/news.html" would give me an problem with the shortcut problem. Any ideas how to get around that?
    The command rundll32 url.dll,FileProtocolHandler http://www.yahoo.com/news/ would work fine, except anything ends with .htm or .html.
    Thanks,
    David

    It looks like url.dll doesnt like .htm or .html files. For more info look here: http://www.jsiinc.com/SUBI/tip4100/rh4162.htm
    For some reason it is confused by the 'm' character in .html which is odd considering it has no problems with .com
    So if you want to keep using url.dll, do something like this:
    replace ".htm" with ".ht%6D"

  • How to call an ABAP based web service from a web page (form)

    Hi,
    I am trying to figure out how I can call my own developed ABAP based web service. I was able to successfully test it in the WS navigator and am now wondering what I need to do to embed the service call in a plain simply web page (form). Basically I'd like to create a web form allowing to specify the parameters and with a 'Submit' button pass the parameters to the web service and launch it.
    Is this possible or do I need some kind of SDK to accomplish this?
    Thanks for any hints and tips.
    Wolfgang

    Hi,
    refer the following link and this is for cosuming the web service form Web dynpro Java
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/50d70a19-45a3-2b10-bba0-807d819daf46&overridelayout=true
    and please go throught the following link if you want to cosume it through web dynpro abap and find the answer given by the Moderator Thomas Jung
    regards
    Manohar

Maybe you are looking for

  • Reading a file which is on different unix box

    Hi, Our project has a requirement to send a file as an attachment in the email to a user. Our application is deployed as an ear in a WAS server (which is a unix box). The interface that actually sends the email is deployed on another unix box. Our ap

  • HT201269 my music on itunes wont sync with my iphone5. what do i need to do to make that happen?

    just picked up an iphone 5. managed to backup/restore and i have all contacts etc on new phone but it wont let me put any music on it. its a new download of itunes as my old hard drive died, could that have any bearing on it? help?!?

  • Cyrptography question.

    I'm trying to make an encryption program that uses the Rail Fence encryption string. If you don't know what that is please visit http://www.cs.uct.ac.za/courses/Course1/110/Tut8/concepts.htm Anyhow what I'm trying to do is create 2 methods. The first

  • Changing global_name

    Oracle 10.2.0.2 Ent edition on AIX 5.3 My db name is db1 and by mistake i edited global_name to db1.oracle.com as below, ALTER DATABASE RENAME GLOBAL_NAME TO db1.oracle.com; Actually global_name is db1 itself since db_domain parameter is null. SQL> s

  • Return an Attribute as an equivilent string?

    I'm new to java (I bet you all hear that one lots...) and I'm struggling with types and casting (I think). The sub/function/method below works just fine and displays the value of the attribute on screen - but I would like to return it to the call. Th