Display pdf in a popup window

Hello @all,
i want to convert a smartform to pdf and show the pdf in an second window or in a popup. When i click on a button in the application, a new window with the pdf should be open. Is this possible to show the pdf in a second window or in a popup. Can anybody help me?

I think you need to create one window and display pdf in it.
Try following code:
1)  Create one Window
2) Create the view to be displayed in popup (add pdf in this view)
3)  Embed the view created in above step in the window created in first step.
4)  Create following attribute in the Component controller:
     I) Z_WINDOW type ref to IF_WD_WINDOW
      Mark the attribute as u2018Publicu2019.
Code to open Window in Popup
  DATA: api_component    TYPE REF TO if_wd_component,
  l_window_manager TYPE REF TO if_wd_window_manager.
  api_component    = wd_comp_controller->wd_get_api( ).
  l_window_manager = api_component->get_window_manager( ).
Create window and pass parameters
  CALL METHOD l_window_manager->create_window
    EXPORTING
      modal        = abap_true
      window_name  = 'ZC_SO_ALV'
      title        = 'Test Popup'
      close_button = abap_true
    RECEIVING
      window       = wd_comp_controller->z_window.
  wd_comp_controller->z_window->open( ).
Regards,
Saket.

Similar Messages

  • How to display a PDF document in popup window

    Hi,
    I have a requirement where i need to display a PDF document to be obtained from a virtual repository and then display it on a popup window.
    Thanks
    DS
    PS: any code snippet or link explaining the above will be helpful

    Use should the ShowProperty servlet in a link or javascript, e.g.:
    <a href="/mywebapp/ShowProperty/path/to/pdf/node
    target="someOtherWindow">pdf</a>
    pdf
    Or, with dyamic node retrieveal (from search or contentSelector,
    assuming node is the pdf Node):
    <a href="/mywebapp/ShowProperty<cm:getProperty node='<%=node%>'
       name='cm_path' conversionType='url'/>
    target="someOtherWindow">pdf</a>
    <a href="javascript:window.open(
       '/mywebapp/ShowProperty<cm:getProperty node=<%=node%">"
    name="cm_path" conversionType="url"/>',
    'SomeOtherWindow',
    'height=400,width=400,scrollbars=auto,resizeable=yes');return false;">
    pdf</a>
    Greg
    Sanjay Datta wrote:
    Hi,
    I have a requirement where i need to display a PDF document to be obtained from a virtual repository and then display it on a popup window.
    Thanks
    DS
    PS: any code snippet or link explaining the above will be helpful

  • Display pdf in a new window

    I need to display the pdf in a new window on click of a button in the iview. The pdf is fetched as an array of bytes from an RFC. It displays correctly, but in the same window. Pls see the extract of the code:
    To Write
    writeText(IPortalComponentRequest request, IPortalComponentResponse response, byte[] pdfResult)
    try{
    Document doc = new Document(PageSize.A4);
    javax.servlet.http.HttpServletResponse myResponse = request.getServletResponse(true);
    myResponse.setHeader ("ContentDisposition", "inline;filename=\"ShortCV.pdf\"");
    myResponse.setContentType("application/pdf");
    OutputStream os = myResponse.getOutputStream();
    os.write(pdfResult);
    PdfWriter.getInstance(doc,os);
    catch(Exception Ex){
    OnView(Event evt){
    JCO.Field Table1 = m_function.getExportParameterList().getField("PDF_STRING");
    client.execute(m_function);
    writeText(request, response, Table1.getByteArray());
    onView is called on
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClick("View");
    myButton11.render(rendererContext);
    Pls advice

    See Display pdf in a new Window in a JSPDynPage

  • UUT serial number is not displayed in batch results popup window?

    UUt serial number is not displayed in batch results popup window. I am using TestStand 2012 SP1 f1 (5.0.1.66). I am also using Prebatch callback and setting up 
    Parameters.ModelData.TestSockets[index].UUT.SerialNumber with the UUT serial number. I have used the exact sequence file with TestStand 4.2 (4.2.0.134) with no problems.

    Sorry for my late reply I was away for work. I actually revisited the code that I implemented with TestStand 4.2 (4.2.0.134) and it is showing the exact problem. Sorry for misleading you. however the UUT report is showing the correct serial number for each unit. This would be something that is nice to have but not critical for my project. I am basically auto discovering all my UUT so instead of scanning the serial number I read it from the UUT memory so there are a lot of steps in my PreBatch call-back but they are all related to reading the UUT serial number. Once I read all the UUTs serial numbers I set the following in a for loop:
    Parameters.ModelData.TestSockets[Locals.For_Loop_Index].UUT.SerialNumber =StationGlobals.UUT_Serial_Numbers[Locals.For_Loop_Index]  
    I tried to implement my a simple PreBatch with only a for loop and an array of serial number and I ended up with the same issue. So I am suspecting that the batch report is getting the serial numbers from a different variable and that variable is set when you run the batch option without the PreBatch call-back.
    Kind Regards,
    Oshana

  • Linking PDFs to open popup windows

    I am working on a project at work in which we have PDF graphics in-line within a web page.  I want to add a link to one of the graphics to call a custom javascript function that is in the page to display a special popup window.  First off, is this possible?  And secondly, if it is, how do I tell it to call the javascript that is in the html page?
    Chris Cote

    In MVVM LIght 5 there is a dialogService you can use for this
    http://marcominerva.wordpress.com/2014/10/14/dialogservice-in-mvvm-light-v5/

  • Displaying PDF in new Browser window

    Hi all,
    I have a question about displaying a invoices in pdf format in a new window. I read several threads about this, but I haven't been able to solve my problem.
    I'm using following code:
    append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'test.pdf'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = ' X'
        i_inplace       = 'X' ).
    The content (lx_pdf) is retrieved from a smartform, via the function module for the smartform in question, after which I convert the OTF Data (JOB_OUTPUT_INFO-OTFDATA) to XSTRING using FM SCMS_TEXT_TO_XSTRING. The returned data (buffer of type xstring) I use for afore mentioned method. But all I get to see is the following:
    //XHPLJIIID    0700 00000000001
    IN04EZZ_MO_SMARTFORM_TEST
    IN05TEST_PAGE_1
    OPDINA4   P 144  240 1683811906000010000100001
    IN06MAIN
    IN06TEXT_TEST1
    MT0168902156
    CP11000000E
    FCCOURIER 120  00144 SF001SF001110000144E
    UL +0000000000000
    CT00000000
    ST0590441This is a text page for displaying PDF in a
    MT0168902396
    ST0547238new window
    MT0168902636
    ST0460832called from within a WD application
    MT0168902876
    ST0144010Application
    EP
    The text is correct, but it is not displayed as PDF in new window, and of course I'm not interested in all the formatting codes in front of every line??
    I should be possible to display a pdf in a new browser window without having installed everything needed for Adobe Interactive forms, or isn't it??
    Kind regards,
    Micky.

    Hi Micky.
    If you have the spool number of the printed billing document you can use
    component WDK_SPOOL_TO_PDF in order to display spool as PDF.
    Just transfer spool number and format to default inbound start up plug.
    Cheers,
    Sascha

  • To load a pdf file in popup window using flex

    Hi All,
    Can anyone send me the code for loading pdf file in a popup
    window using flex.
    Regards,
    Dharma

    try this action script
    var pdfUrl:URLRequest = new URLRequest("assets/file.pdf");
    navigateToURL(pdfUrl,"_blank");

  • Display PDF document in Flex Windows application

    Hi,
    I am creating a flex windows application using action script and mxml script.I need help in displaying a PDF document in that windows application.I tried google search it is giving me some open source projects with IFrames.But,they can be only used for browser applications(web).So,anyone please suggest me how could i accomplish this task with winows application.
    Thanks,
    adi2010

    Hi Everyone,
    I got the solution for my issue.We need to use HTMLLoader to load the PDF documents in Windows aplication for Flex.

  • Adobe Reader won't display PDF in IE Browser Window

    I am using Adobe Reader XI and Internet Explorer v. 11.0.9600.17280.
    I have tried uninstalling and re-installing Adobe.  I've also checked IE Add-Ins and all Adobe Reader Add-Ins are enabled.
    However, you're poorly written software STILL WILL NOT display PDFs in browser any more.
    I need help, but since you're software is so horrible, you do not offer typical technical support.
    PLEASE HELP!

    My company is having the same problem and I was hoping for some kind of final explanation.
    The fix of resetting the Internet Explorer settings works for a time, then it later it has the problem again.  Our company has a reporting site which needs the documents to open in the browser to allow for drill down(generating another report based on a link in the document), so the reports have to be in the browser not a separate Adobe Reader Window.  We have tried other fixes on the Web like the TabProcGrowth=1, but still the problem happens later.
    Our users are tired of resetting their Internet Explorer settings every week or more.  As this has worked in all previous versions, I would agree the issue probably lies in Internet Explorer or at least partly in Internet Explorer, but we need some way to keep the files opening in the browser rather than a separate Reader window.  Any additional thoughts or fixes by anyone would be greatly appreciated.

  • Problem displaying PDF file in new window.

    Using NetBeans 6.5, Internet Explorer 7.
    I am using the code example from BalusC at the site:
    http://balusc.blogspot.com/2006/05/pdf-handling.html
    I am having no problem reading and displaying the PDF file, but it displays it in the same window,
    not a new window and it overwrites the current page, so I can't use the back arrow to fetch the page that is overwritten.
    I am using a commandLink to fetch the file.
    Does anyone know why I am not getting a new window or tab for the display?
    The jsp portion for the link is:
    <h:commandLink action="#{MainPage.linkAction3_action}" id="linkAction3"
              style="color: rgb(0, 0, 0); font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-weight: bold; left: 280px; top: 0px; position: absolute"
              target="_blank" value="Insurance Document"/>The "MainPage.linkAction_action" method just makes a call to the display function:
        public String linkAction3_action() {
            sb1.setMessage("");
            dsb.setFilePath("C:/");
            dsb.setFileName("Insurance_Summary.pdf");
            dsb.downloadPDF();
            return null;
        }And the downloadPDF() method is basically a cut and paste from the BalusC site;
        public void downloadPDF()
            // Reference:   http://balusc.blogspot.com/2006/05/pdf-handling.html
            // Prepare.
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ExternalContext externalContext = facesContext.getExternalContext();
            HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
            File file = new File(getFilePath(), getFileName());
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open file.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                // Init servlet response.
                response.reset();
                response.setContentType("application/pdf");
                response.setContentLength( (int)file.length());
                response.setHeader("Content-disposition", "inline; filename=\"" + fileName + "\"");
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            catch( Exception e )
                System.out.println( "Error displaying file.");
            finally {
                // Gently close streams.
                close(output);
                close(input);
            // Inform JSF that it doesn't need to handle response.
            // This is very important, otherwise you will get the following exception in the logs:
            // java.lang.IllegalStateException: Cannot forward after response has been committed.
            facesContext.responseComplete();
        }

    1) window.open will open a new window and call a servlet.
    window.open ("http://path_to_yourservlet/PDFServlet", "newWindowName");
    if you ant to pass some values from your web page to the servlet you can pass as
    window.open ("http://path_to_yourservlet/PDFServlet?param1=value1&param2=value2", "newWindowName");
    2) The servlet will fetch and display the pdf file.
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class PDFServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet
         private final static int DEFAULT_BUFFER_SIZE = 1000;
         public PDFServlet()
              super();
         public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              String fileName = "Insurance_Summary.pdf";
              File file = new File("C:/"+fileName+"");
              response.setContentType("application/pdf");
         OutputStream output = response.getOutputStream();
         BufferedInputStream input = null;
         //BufferedOutputStream output = null;
         try {
         // Open file.
         input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
         response.setContentLength( (int)file.length());
         response.setHeader("Content-disposition", "inline; filename=\"" + fileName + "\"");
         output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
         // Write file contents to response.
         byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
         int length;
         while ((length = input.read(buffer)) > 0) {
         output.write(buffer, 0, length);
         output.flush();
         catch( Exception e )
         System.out.println( "Error displaying file.");
         finally {
         input.close();
    Regards,
    Milind Dhar

  • Display pdf in a new Window in a JSPDynPage

    I need to display the pdf in a new window on click of a button in the iview. The pdf is fetched as an array of bytes from an RFC. It displays correctly, but in the same window. Pls see the extract of the code:
    To Write
    writeText(IPortalComponentRequest request, IPortalComponentResponse response, byte[] pdfResult)
    try{
    Document doc = new Document(PageSize.A4);
    javax.servlet.http.HttpServletResponse myResponse = request.getServletResponse(true);
    myResponse.setHeader ("ContentDisposition", "inline;filename=\"ShortCV.pdf\"");
    myResponse.setContentType("application/pdf");
    OutputStream os = myResponse.getOutputStream();
    os.write(pdfResult);
    PdfWriter.getInstance(doc,os);
    catch(Exception Ex){
    OnView(Event evt){
    JCO.Field Table1 = m_function.getExportParameterList().getField("PDF_STRING");
    client.execute(m_function);
    writeText(request, response, Table1.getByteArray());
    onView is called on
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClick("View");
    myButton11.render(rendererContext);
    Pls advice

    Detlev .....
    I am still not able to implement your suggested solution.
    If I call javascript written in JSP, will I be able to pass a bean to it. Pls see the code that I hv in addition to the one posted ...
    In ICellRenderer ....
    if ( column == 11 )
    Button myButton11 = new Button("myButton11");
    myButton11.setText("View");
    myButton11.setOnClientClick("Test("beantv2")");
    In JSP
    <script>
    function Test(zBean)
    popAssetWinSpecs = "left=250,top=250,width=300,height=300,scrollbars=no,toolbar=no,menubar=no,resizable=no,status=no,titlebar=no,location=no";
    htmlfile="/irj/servlet/prt/portal/prtroot/AIPLetters.HersheyTeamViewerAIPPDF?zBean="+zBean;
    window.open(htmlfile,"editWindow",popAssetWinSpecs);
    return false;
    </script>
    in the doInitialization of the second comp
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext compcontext = request.getComponentContext();
    AIPBean = new HersheyTeamViewerAIPBean();
    HttpServletRequest zHttpRequest = request.getServletRequest();
    AIPBean = (HersheyTeamViewerAIPBean)zHttpRequest.getAttribute("zBean");
    nothing gets executed ....
    I am not sure whether I am passing the bean correctly
    Thanks for your help,
    Devina

  • Issue with displaying ALV in a popup window

    Hi Experts,
    I am trying to create an popup window with an ALV in it. TO display the ALV i have defined the component usage for SALV_WD_TABLE component.When the ALV is displayed for the first time it shows up correctly with required data. When i try to display ALV popup again only the popup window frame gets displayed the ALV is missing from the popup window.
    If i refresh the main component by clicking browser refresh buttion and then click for ALV popup dsplay i get the correct popup display the first time and then agin the same issue.
    Has anyone else come across this issue before. All your suggestions, responses are welcome.
    Thanks,
    Vivek

    HI,
    My popup window has only one embedded view, the TABLE view of used component SALV_WD_TABLE hence i cannot modify the TABLE view.
    I tired putting the following code for context node initialization in both the the methods WDDOONOPEN and WDDOINIT of the window which has the embedded view. But it dosen't make any difference i face the same issue even with these changes.
    types: begin of  ty_belnr,
             belnr type vbkpf-belnr,
           end of  ty_belnr.
    data: lt_belnr type standard table of ty_belnr,
          lo_node type ref to if_wd_context_node,
          lo_element type ref to if_wd_context_element.
    select belnr
      from vbkpf
      into table lt_belnr
    where ausbk = 'UC'
       and bukrs = 'UC'
       and gjahr = '2011'
       and usnam = sy-uname.
    if sy-subrc eq 0.
       lo_node = wd_context->get_child_node( 'DOC_NUMBERS').
       lo_node->bind_elements( new_items = lt_belnr[] ).
    endif.
    Edited by: Vivek Priyadarshi on Sep 14, 2010 5:24 PM

  • How to display error message in Popup window

    Hi,
    I have main view and when I click button I opened new pop up window.
    I have some validation for the form in pop up window. I want to display the error message in pop up window.
    Please let me know how to get it.
    Thanks

    Hi mami,
           Is is very difficulty to request focus to the POP window..in our case we are trying lot of time ..but we are not success to display massage in pop window.
    you will  put TEXTView in you pop window where you want to display massage in you POPWINDOW.
    and Create one context value Attribute as Massage
    Value Attribute-----ErrMassage.
    ErrMassage Attribute set your Text property of TEXTVIEW  UI Element.
    If(your condition is TRUE){
    //Excute Your code perfectly.
    else
    wdContext.currentContextElement().setErrMassage("Please provide proper name");
    In this way we were this massage showing in our popwindow..
    thanks
    jati

  • Display pdf only in browser window

    Does anyone have custom code or javascript that will force a
    pdf to open in a user's browser window rather than follow their
    browser setting? I don't want the user to have the option of
    downloading the pdf and launching Reader.
    Thanks.

    .oO(lanoffs)
    >Does anyone have custom code or javascript that will
    force a pdf to open in a
    >user's browser window rather than follow their browser
    setting? I don't want
    >the user to have the option of downloading the pdf and
    launching Reader.
    Impossible.
    1) To be able to read the file it has to be downloaded to the
    user's
    machine.
    2) To view it directly in the browser, there has to be a
    plugin
    installed and activated, which is not always the case.
    Micha

  • Popup window  opens in the second page  - plz help gurus.

    Hi All,
    I'm calling a transaction through ITS. There is a hyperlink in a report brings up PDF in the popup window. Popup window comes up in the second page of the report after closing in the first page of the report. Popup comes in all the consecutive pages of the report once I click on the hyperlink. This is really frustrating. Pls let me know if i need to do any configuration to avoid this problem. 
    Thanks,
    Kumari

    Hello Kumari,
    are you using the SAP GUI for HTML (webgui)? Normally, no hyperlinks are used except on documents inside an HTMLviewer (like in TX TRIP), or when Drag & Relate is activated.
    I suppose the link is part of a document that is shown in an HTMLviewer. Though this document does not belong to the ITS or the SAP GUI for HTML it uses ITS's URLs to address a new page or document. But, with this URL the status of the ITS or the application does not change, thus showing the popup over and over.
    If you have a tool to trace the HTTP protocol you can check for the URLs that are send on a particular action. I
    Best regards,
      TJ

Maybe you are looking for

  • Best way to re-install OSX for resale after hard drive wipe

    Just got a new MacPro and having transferred everything from my early 2008, I have a buyer for that machine. I want to only give him OSX Mavericks and some legally transferrable applications. What is the best way to do this?

  • How to get document's length of JTextPane

    Hi all, I loaded the content of JTextPane by invoking setPage(URL url), but the length of the styledDocument is ZERO textPane.setPage(new URL("http://www.google.com")); StyledDocument doc = textPane.getStyledDocument(); System.out.println("doc.getLen

  • Error: ORA-12008: error in materialized view refresh path

    Hello Dba' s We are on 12.0.6 EBS with 10.2.0.5 DB on Sun solaris SPARC 64 bit. We are getting below error while Refreshing Materialized View. Start of log messages from FND_FILE Error: ORA-12008: error in materialized view refresh path ORA-00600: in

  • Child creation Error on vms HELP

    Hi, Iam trying to execute a file from withing a java program on VMS This is my code public class BAMBOE {   public static void main(String[] args) {      BamboeRunner boe = new BamboeRunner();     boe.start(); import java.io.*; public class BamboeRun

  • Password Manager doesn't work for me now!!!

    I had start up problems with my laptop so I had to get all my files retrieved from the HD and reload them. When I did a cut and paste after reinstalling TB all my data come back which was excellent. Unfortunately, when I selected "Get Messages" nothi