Display Archived Document in Abap Webdynpro without opening new window.

I would like to create a wd4a application that receives the parameters of Archive ID and Doc ID and displays the archived document.  The document is stored as a pdf on SAP's content server.  Currently the webdynpro will open a separte blank Window.  I have not defined any view elements to the embedded view because I do know which view element I should to display the archived documente.  I have a url to the document and it will get displayed by creating an new window by executing  the code below to launch the file in a separate window.   The Adobe Viewer creates a new window to view the document.  Does  anyone know what view Uielement I should use to view the document in the main window and main view?
Thank you
Tom
data ld_url type dms_url.
data ls_message type bapiret2.
  call function 'SCMS_AO_URL_READ'
    exporting
      MANDT               = SY-MANDT
      arc_id              = id_archive_id
      doc_id              = id_arc_doc_id
      COMP_ID             =
      DOCUMENT_TYPE       = ' '
      PDF_MODE            = 'A'
      HTTP_URL_ONLY       = ' '
      DP_URL_ONLY         = ' '
       loc_info            = 'F'
      LIFETIME            = 'T'
      NO_CACHE            = ' '
   importing
     url                 = ld_url
   exceptions
       error               = 1
       others              = 2
assert sy-subrc = 0.
added by YINS Mar.05 2007
  if sy-subrc <> 0.
    ls_message-type = 'E'.
    ls_message-id = sy-msgid.
    ls_message-number = sy-msgno.
    ls_message-message_v1 = sy-msgv1.
    ls_message-message_v2 = sy-msgv2.
    ls_message-message_v3 = sy-msgv3.
    ls_message-message_v4 = sy-msgv4.
    append ls_message to wd_this->mt_messages.
   wd_this->flush_messages( ).
    return.
  endif.
  data:
    lr_api_comp_controller  type ref to if_wd_component,
    lr_window_manager       type ref to if_wd_window_manager,
    lr_window               type ref to if_wd_window,
    ld_url_str              type string.
  lr_api_comp_controller = wd_this->wd_get_api( ).
  lr_window_manager = lr_api_comp_controller->get_window_manager( ).
  ld_url_str = ld_url.
  lr_window = lr_window_manager->create_external_window(
      url   = ld_url_str
  lr_window->open( ).

I found a solution after much troubleshooting including uninstalling/reinstalling Office 2010 which didn't solve the issue. 
Here it is:
When Outlook or some other Office program is minimized in the taskbar and won't open, right click the taskbar to bring up task manager. 
Right click the program in the task manager list that is giving trouble and click Maximize.  You should now see a full screen.
This worked for me and solved the "open and stays minimized" delima.  Hope this helps you too.  Cheers :)
Thanks a bunch this saved me a potential headache!

Similar Messages

  • Display Word Document in ABAP WebDynpro

    Hi All,
    We have a number of word documents stored in the Business Document Navigator (Transaction OAOR) that we would like to display within a simple ABAP WebDynpro.  Demo program SAPRDEMO_FORM_INTERFACE shows how to retrieve a document from BDS via class cl_bds_document_set.  However, I am not seeing a similiar program for ABAP Web Dynpro.
    I was hoping that WebDynpro test application IOS_TEST_SIMPLE_MS would do the trick; however that appears to only work for a MIME repository object.  Is there a way to display these documents through ABAP WebDynpro?  Can anyone point me to a sample program?  Thanks.
    John

    Hi John
    Have a look at this thread [     Approach content repository other way then URL approach  |Re: Approach content repository other way then URL approach;.
    Thomas Jung delivers some (as always) excellent answers to a very similar problem. If the document is in DMS or BDS really doesn't matter so if I were you I would follow the "cached response" path.
    Also, do a google-search for --  abap "cached response" -- and you will find some additional links here (Thomas has even more to offer...).
    If you do follow this path please share some details as a follow up in this thread for the benefit of the community at large.
    Regards, Johan

  • Download a file without opening new window

    Hi everybody,
    I need to save a file to local PC into a certain predefined file in such a way that user does not get any pop-ups or new windows - i.e. 'in background'.
    I have tried 'FileDownload' - this get file content displayed in new window and if saved is to be allowed - a save pop-up is displayed.
    If I try attach_file_to_response of cl_wd_runtime_services - it also gives a pop-up.
    Does anybody know a way to download a file to local PC in such a way that the content of the file is not displayed in the new pop-up window and save dialog does not appear?
    Thank you for your help.
    Helen

    Hi Olena,
    You will not be able to download a file in the background due to the browser security defaults. All browsers always prompt the users to accept files otherwise viruses and trojans would be able to be installed on your pc without you accepting them.
    I know it is possible to write via SAPGui without a prompt but not from a browser.
    Sorry.
    Richard
    PS Dont forget the points!

  • HTTP form post from Web Dynpro Java Application without opening new window

    Hi Experts,
    We are trying to submit form data to an external URL from Web Dynpro Java application. We are achieving this with the following piece of code.
      try
       strPrintContent="<html>"+
         "<head>"+
         "<script type=\"text/javascript\">"+   
         "function myfunc () "+
         "{"+
         "var frm = document.getElementById(\"paymentForm\");"+
         "frm.submit();"+
         "}"+
         "</script>"+
         "</head>"+
         "<body onLoad=myfunc()>"+
         "<form id=paymentForm  method=post action=\""+merchantURLPart+"\">"+
         "<INPUT type=hidden name=username value="+userName+">"+
         "<INPUT type=hidden name=pass value="+passWord+">"+
         "<INPUT type=hidden name=senderid value="+senderID+">"+    
         "<INPUT type=hidden name=dest_mobileno value="+mobile+">"+
         "<INPUT type=hidden name=message value='"+msg+"'>"+
         "<INPUT type=hidden name=response value="+response+">"+
         "</form>"+
         "</body>"+
         "</html>";    
      IWDWebResource webResource = WDWebResource.getWebResource(strPrintContent.getBytes(),WDWebResourceType.HTML);
      IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(webResource.getAbsoluteURL(),"WBSEDCL");
      window.show();
      catch(Exception e)
      wdComponentAPI.getMessageManager().reportException("Error : "+e.toString(),false);
    But it opens another window. We dont need that. We have to stay on the same window.  Please suggest what can be done.

    Hi,
    You can create a HTML file with the request post parameters and the external URL something like this:
    public java.lang.String GetRedirecturl( )
    // External URL
    String html = "<html><head></head><body onload=\"load()\"> " +
    "<form id=\"form1\" action=\"https://www.abc.com/xyz.jsp\" method=\"POST\">" +
    // Post Parameters
    "<INPUT TYPE=\"HIDDEN\" NAME=\"Param1\"VALUE=\""+Param1Value+"\">"+
    "<input name=\"sap-wd-resumeurl\" type=\"hidden\"/>" +
    "</form> " +
    "" +
    "<script>" +
    "function load(){" +
    "var loc = window.location.search.substring(1);" +
    "var queryString = loc.split(\"sap-wd-resumeurl=\");" +
    "if(queryString.length > 0)" +
    "{" +
    "var resumeURL = queryString[1].split(\"&\");" +
    "if(resumeURL.length >= 0)" +
    "{" +
    " document.forms['form1'].elements['sap-wd-resumeurl'].value= unescape(resumeURL[0])" +
    "}" +
    "}" +
    "document.getElementById('form1').submit();" +
    "}" +
    "</script>" +
    "</body> </html>";
    String redirectUrl = "";
    byte[] byteArrayHtmlData = null;
    try {
      byteArrayHtmlData = html.getBytes("UTF-8");
    } catch (UnsupportedEncodingException e) {
      wdComponentAPI.getMessageManager().reportException("Internal error occurred. Please try after some time",true);
    IWDResource htmlResource = WDResourceFactory.createCachedResource(new ByteArrayInputStream(byteArrayHtmlData), "Redirect.html", WDWebResourceType.HTML, true);
    redirectUrl = htmlResource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());
    return redirectUrl;
    Hope this will be helpful.
    Regards,
    Anurag

  • Submitting variables to an ASPX file WITHOUT opening new window

    Hello,
    I'm trying to submit some variables from my flash to an aspx page on a different domain which will handle them and put them in a database.  I've tried a number of options, but the only ones that have worked also result in a new window/tab being opened, and I am trying to avoid this. 
    For example, I tried a loadVars with the sendAndLoad() function, but it did not work because the "load" portion requires the aspx page to be on the same domain as the swf- which it is not.
    the send() function does not work either, because it requires you to specify a target (_self, _blank, etc) and that causes a new tab to open, or a redirection on the current page- both unacceptable, as I am trying not to interupt the user's experience on the page the swf is featured on.  send() does succeed in submitting the variables, at least, but as I said, it opens a new tab/redirects current tab.
    One solution is to enable outside domains access on the server-side, but this is not ideal.  I'm hoping for a flash solution.  Any thoughts?
    here's the code:
    var dataLoader = new LoadVars();
    var junkLV:LoadVars = new LoadVars();
    junkLV.onLoad = function(success:Boolean) {
        if (success) {
            trace("We are in business.");
            greenLight_mc._alpha = 100;
        else {
            trace("FAIL");
            redLight_mc._alpha = 100;
    dataLoader.firstname = firstName;
    dataLoader.lastname = lastName;
    dataLoader.email = emailAddress;
    dataLoader.dest = destination;
    dataLoader.sendAndLoad("url.aspx", junkLV, "POST");

    Oh I'm sorry now I understand why you were asking.  the "url.aspx" is not the actual URL.  It will be a full url in the form http://www.domain/directory/file.aspx, which will indeed be on another domain.
    Sorry for the confusion. 

  • Firefox 4 stops opening new windows after browser window dragged to second display

    Firefox 4 stops opening new windows after browser window dragged to second display. It's weird. Behavior is fine until I drag any browser window to the attached second display, and after this point it stops opening new windows but will still open new tabs in the same window. Restart fixes it until I drag the window back to the second display.
    "Show all bookmarks" stops working too--won't open a new window.
    This is after clean reinstall with total deletion of any Firefox/Mozilla folders and the previously installed app and a restart of the computer.
    Mac OS X 10.6.7
    Firefox 4

    Pretty sure this is either:
    '''Bug 644733'''
    or
    '''Bug 609405'''
    (...and they may be reporting the same thing.)

  • Safari always opens new windows/tabs

    Every time I click on a link Safari opens a new window or tab instead of just going to that link in the window that I am in. So when I close Safari I have multiple pages/tabs open.  It used to just go from page to page without opening new windows or tabs. What setting needs to be changed to get back to the single window?

    I figure out what the problem is. I set the Google search to open link in new window, and then it can be opened in tab with one tap. Thanks for help!

  • Opening new window on button click from pdf without loosing session

    Hi,
    In my Java web applicaion on click of a link, we are opening a new window in which we are displaying a pdf. There are 5 buttons on this pdf.
    On clicking of this button again we are opening a application link in new window. But in this window we are not gettting our session, which is there in first two window.
    For opening new window from pdf button click we are using
    var dynamicUrl3 = myappurl;
    app.launchURL(dynamicUrl, true); 
    How can i open new window with the same sesion from the pdf button.
    Please help for the same.
    Thanks,
    Abhijit Mohite.

    Yes, with target="_blank" in a link or a form.Thanks for ur valuable suggestion. I changed the button to link.
    Its working fine now without JavaScript.
    Now i got another requirement. When user select some items and press a button in the new popup window, the window must close on button click and the parent window must refresh. This must also be done without using JavaScript.
    Is this possible? Please give me an idea to do this.
    Thanks.

  • To open a pdf document or word document from a JSP into a new window

    Hi,
    How to open a PDF document or word document from a JSP into a new window. i.e say from a jsp when a hyperlink or button is clicked it should open a new window with the pdf document or word document in it.
    thanks in advance,
    radki_j

    Hi ,
    when i tried to use the below code to open my word document , it will open as html and with some garbage details. Doesnt open as word document. How to solve this kind of probem?Need advice urgently.
    Open Document

  • Help in creating XML documents in ABAP using XI in new version ECC6.0

    Hello All:
       I am pretty comfortable with XML and XSLT but new to XI. Is there a way of creating XML documents in ABAP using XI in new version ECC6.0? Please provide me with any links or any information you may have. All the answers will be rewarded.
    Thanks.
    Mithun

    hi,
    U cant create XML data in ABAP.
    to send the data to the XI, u have to use the IDOC or RFC FM, from there IDOC or RFC adapters will read the data in the same  format  and these adapters will convert the data in to  XML .Bcoz XI understand only XML data.
    from there XI will process and route them to Destination, by using anthor adapter.
    here u can use file adapter if u want data in file foramat from the IDOC or RFC .
    So XI is the integration tool only.
    reward points if helpful
    ragards
    sreeni

  • When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs

    When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs
    == This happened ==
    Every time Firefox opened
    == Noticed yesterday, June27, 2010

    i just went into preferences, deleted what was in the home page, and entered a new home page address which solved the problem, 

  • How to stop Finder from opening new windows to view contents of folders.

    I have 2 folders on my desktop, called "Home" and "Work." Both are aliases to files stored in user/documents on my HD. Both contain many folders within folders within folders and, ultimately, documents. When I double click on the "Home" desktop alias, a finder window opens showing contents. When I click on any folder within that window, it does what I want it to...switches to the contents of that folder (within same window, without opening a new one.) This works for everything in that folder.
    When I double click on a folder within the "Work" folder, however, it opens a new window at every level. By the time I get to the document I want, I may have 5 or 6 windows open, which I then have to manually close.
    I have gone into Finder/Preferences/General and the "Always open new window" box is NOT checked. Any one know why it would still be doing this? (No new applications are opening when I click on the folders, just a new finder window.) And why would it do it for one desktop folder and not the other?
    I looked through discussions till my head spun and only saw the Finder/Preferences fix, so I'm hoping there's another fix, like a preference file somewhere that I just need to trash. Any help would be appreciated.
    Powerbook G4   Mac OS X (10.3.9)  

    I don't know if this is the problem, but for windows in "Icon" or "List" view that are set so that the "Toolbar" is not showing, a folder opened within that window will tend to open a new window. This is just a difference in behaviour between the two modes. To show / hide the toolbar, try clicking the elongated button in the upper right corner, in the "titlebar" of the window, or choose "Show Toolbar" / "Hide Toolbar" from the "View" menu.
    Additionally, a workaround might be to switch to "Column" view ("View" > "as Columns" ⌘3), since opening a folder within a window in "Column" view does not appear to spawn a new window, even with the "Toolbar" hidden. Another option might be to hold down the "option" key while opening the folder - this causes the previous window to close as the new window is opened.

  • MassCommand Opening New Window

    Hello....
    Does anyone know if I can create a new custom command that allows the user to select a resource (i.e. like a mass command event), select the command, and open a new window....
    For example... I would like to be able to select a resource and display the properties of that resource (details-->properties)
    I can get it to work if I extend AbstractCommand, but not if I extend AbstractMassCommand.  Does AbstractMassCommand support the getLinkAttributes method?
    Any help is much appreciated.

    We have contacted SAP and they informed us that the getLinkAttributes() method usually used for things like opening new windows is not applicable to mass commands.  They went as far as to say that it didn't make sense to open new windows based on mass commands.
    Having said that, I have come up with a less than perfect workaround.  If you implement the AbstractMassCommand interface and do something similar to the following:
    public IRenderingEvent execute(IScreenflowData sfd) throws WcmException
    TextView tv = new TextView("<script>window.open('http://www.cnn.com');</script>");
    tv.setEncode(false);
    ConfirmComponent cc = new ConfirmComponent(ConfirmComponent.OK_CANCEL, this.getResourceContext().getLocale(),tv);
    OneStepScreenflow oscf = new OnseStepScreenflow(sfd,this.getAlias(),resource.getRID(),cc);
    return oscf.execute();
    The trouble with this is it forces you to have a one step screen with a confirm component on it... not the ideal case for what I wanted to do.
    I have not so far figured out how to fire JavaScript from the original window without going to the secondary window.
    Hope this helps some, and if you find any more please let me know.

  • How to open new window and generate oracle report from apex

    Hi,
    I had created an application that generates PDF files using Oracle Reports, following this Guide.
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_integrate_oracle_reports.html
    And I followed 'Advanced Technique', so that users can't generate PDF file by changing URL and parameters. This is done for security reasons.
    But in this tutorial, when 'Go' button is pressed, the PDF file is displayed on the same window of apex application. If so, user might close the window by mistake. In order to avoid this, another window have to be opened.
    So, I put this code in the BRANCH - URL Target. (Note that this is not in Optional URL Redirect in the button property, but the branch which is called by the button.)
    javascript:popupURL('&REPORTS_URL.quotation&P2100_REP_JOB_ID.')
    But if the button is pressed, I get this error.
    ERR-1777: Page 2100 provided no page to branch to. Please report this error to your application administrator.
    Restart Application
    If I put the code 'javascritpt ....' in the Optional URL Redirect, another window opens successfully, but the Process to generate report job is not executed.
    Does anyone know how to open new window from the Branch in this case?

    G'day Shohei,
    Try putting your javascript into your plsql process using the htp.p(); procedure.
    For example, something along these lines should do it:
    BEGIN
    -- Your other process code goes here...
    htp.p('<script type="javascript/text">');
    htp.p('popupURL("&REPORTS_URL.quotation&P2100_REP_JOB_ID.")');
    htp.p('</script>');
    END;
    What happens is the javascript is browser based whereas your plsql process is server based and so if you put the javascript into your button item Optional URL Redirect it is executed prior to getting to the page plsql process and therefore it will never execute the process. When you have it in your branch which normally follows the processes, control has been handed to the server and the javascript cannot be executed and so your page throws the error "Page 2100 provided no page to branch to"... By "seeding" the plsql process with the embedded javascript in the htp.p() procedure you can achieve the desired result. You could also have it as a separate process also as long as it is sequenced correctly to follow your other process.
    HTH
    Cheers,
    Mike

  • How stop FF31 from opening new window? I want to open all links in new tab at top of page.

    I think the following, quote below, from the help page is my problem.
    I have this one website I use that when I click on a link within the website it is opening a new window with the tab at the bottom. Also, when this happens, I am losing the orange FireFox rectangle, bookmarks and navigation options. How can I set FF31 so that the link opens in a new tab and I keep all my options? I am using Classic Theme Restorer 1.2.3. I also notice that in the new window I lose the ability to use some of the addons.
    I have two laptops and both are running FF31 and W7. One of them is working perfectly and the other is having this problem. As far as I can tell they are both set up the same. The only difference is that when I upgraded to FF31 they both had difference older versions of FireFox. I also read in the help forum that maybe I need to go back to FireFox 28 to accomplish what I am trying to accomplish.
    I noticed that when I go under about:config that the version of FF that is not working has fewer available options versus the version that is working. An example would be that the working version has "browser.tabs.onTop" where on the other laptop this is missing.
    >>>Open new windows in a new tab instead: This option controls whether links from other applications or from web pages which request to open them in new windows are opened in a new window or a new tab in the most recent window.
    Note: If you have chosen to open pages in new tabs, Firefox will ignore this option and will open a new window from a link if the page author specified that the new window should have a specific size, because some pages can only be displayed correctly at a specific size.<<<
    Thank you in advance for any help,
    yeto

    You can override how links are opened via the browser.link.open_newwindow.override pref.
    *http://kb.mozillazine.org/browser.link.open_newwindow
    *1: current tab; 2:new window; 3:new tab;
    Use this for links opened via JavaScript.
    *http://kb.mozillazine.org/browser.link.open_newwindow.restriction
    See also:
    *http://kb.mozillazine.org/Prevent_websites_from_disabling_new_window_features

Maybe you are looking for