Display archive doc as pdf from web dynpro?

Hi All,
We have a situation where we want to display archived pdf's from a web dynpro.  I have put an interactive form ui element on my view and bound this to an attribute of type xstring on the context.
When I run it, i get an error message saying that file does not begin with '%PDF-'.  I've tried putting this on the front of the string but i didn't work either.
So can anyone tell me the process for displaying archived pdf's from a web dynpro.
Many thanks in advance,
Liz.

This is the code necessary to get it to work:
get optical archive id of pdf to display
    select single * from toahr into ls_toahr
      where sap_object = 'PREL'
        and OBJECT_ID  = lv_obj_id
        and ar_object  = ls_zhr_paylsip-zhr_doc_type.
    lv_archiv_id  = 'H1'.
    lv_document_type = ls_toahr-ar_object.
    lv_archiv_doc_id = ls_toahr-arc_doc_id.
    lv_signature = 'X'.
    lv_compid = 'data'.
    free lt_binarchivobject.
    call function 'ARCHIVOBJECT_GET_TABLE'
      exporting
        archiv_id                      = lv_archiv_id
        document_type                  = lv_document_type
        archiv_doc_id                  = lv_archiv_doc_id
  ALL_COMPONENTS                 =
       signature                      = lv_signature
       compid                         = lv_compid
     importing
       length                         = lv_length
       binlength                      = lv_binlength
     tables
       archivobject                   = lt_archivobject
       binarchivobject                = lt_binarchivobject
     exceptions
       error_archiv                   = 1
       error_communicationtable       = 2
       error_kernel                   = 3
       others                         = 4.
    if lt_archivobject[] is not initial.
      describe table lt_archivobject lines lv_rowcount.
      lv_rowcount = lv_rowcount * 1024.
      call function 'SCMS_BINARY_TO_XSTRING'
        exporting
          input_length = lv_rowcount
          first_line   = 1
          last_line    = lv_rowcount
        importing
          buffer       = lv_xstring
      tables
        binary_tab   = lt_binarchivobject
      exceptions
        failed       = 1.
    endif.
Where yo bind lv_xstring to the the pdfSource via the context

Similar Messages

  • Print a PDF from Web Dynpro

    Hi all gurus.
    I developed a Web Dynpro application to let the users create their own sales orders.
    Now I need to let them print the orders when they need to. Searching on the documentation I have, I've never found anything about crating a pdf print from the WD Application.
    There must be a way, because I managed to do that even with the very old ITS (the one in which you had to write HTML code...) but i cannot find how.
    Can anyone help me please? Even a tutorial would be very appreciated.
    Thank you in advance...

    >
    horatiusx wrote:
    > Hi all gurus.
    >
    > I developed a Web Dynpro application to let the users create their own sales orders.
    >
    > Now I need to let them print the orders when they need to. Searching on the documentation I have, I've never found anything about crating a pdf print from the WD Application.
    >
    > There must be a way, because I managed to do that even with the very old ITS (the one in which you had to write HTML code...) but i cannot find how.
    >
    > Can anyone help me please? Even a tutorial would be very appreciated.
    >
    > Thank you in advance...
    You need a Smartform, SAPScript, or AdobeForm to be defined for your output.  Define an action/method for print, then pass the data to your Form.  SmartForms are not bad, as SmartForms generate a Function Module, and are easy to call.
    Call the SmartForm Function with PDF output = 'X' (parameter within Output Control I think).  Then pass the PDF_DATA[] table (type = TAB_SOLIX) to a new window output .
    Don't have the code in front of me, but have done it several times.  
    Adobe Forms is another good option, but you need Adobe Server, and generally I have found ADOBE to be SLOOOOOWWWWW.  I think Steve Jobs might have been on to something with ADOBE -- just my opinion.
    And of course, it can be done with SAPSCript, but I would need a whole blog on how to do that.....

  • Regd PDF Printing from Web Dynpro

    Hi,
    We are using NW04s SP10 . I need to show the data coming from RFC as PDF in Web Dynpro. The RFC is returning String as output after SAP Script is converted to PDF . Below is the code i have written in WD for opening as PDF. When i try to open it as PDF, I am getting message in acrobat reader  "<i>The file is damaged and could not be repaired</i>" . Did anyone faced the similar problem before?
    //Converting the string to binary
    b = wdContext.nodeOutput().nodeBinary_File().getBinary_FileElementAt(i).getBin_File().getBytes();
      pdfResource=WDWebResource.getPublicCachedWebResource(b,WDWebResourceType.PDF,WDScopeType.CLIENTSESSION_SCOPE,wdThis.wdGetAPI().getComponent().getDeployableObjectPart(),"Test"+i);
    pdfResource.setResourceName("test.pdf");
       wdComponentAPI.getWindowManager().createExternalWindow(pdfResource.getURL(),"Test"+i,false).open();     
    Thanks,
    Vasu

    Hi all,
    I am able to solve myself. The problem is with the generated data. Now i am able to see the PDF but i am facing issue in showing the data in pdf which i have posted in another thread.
    Thanks,
    Vasu

  • How to display smartform as PDF in web dynpro java

    Hi,
    Where can I find sample program to display smartform as PDF in web dynpro java.
    Thanks.
    Regards,
    Henry

    1. Create a smart form in the R/3 side
    2. Now create a function module with the corresponding export parameter:
    3. Make sure that the function module is marked remote enabled. 
    4. In NWDS  create an Adaptive RFC model which points to the FM created in R/3 under the webdynpro application
    5. Now create an application and view inside it to display the PDF and Insert a frame inside the view
    6. Create a  value node and an attribute say url of type string inside that node and bind it to the source
    7. In the doInit() method place the following code
    >    ZTest_Pdf_1_Input input = new ZTest_Pdf_Input();
    >    wdContext.nodeZTest_Pdf_Input().bind(input);      
    >    try {                       
    >            wdContext.currentZTest_Pdf_InputElement().modelObject().execute();
    >            }
    >  catch (Exception e) {
    >                        e.printStackTrace();
    >            }          
    >  wdContext.currentInternalElement().setUrl(convert(wdContext.currentOutputElement().getBin_File()));       
    Inside that view create a method to convert the string to url so that it can be passed as a string to the setUrl method of the currentContextElement() , say convet(byte[] doc_content) which return a string.
    Inside that methos write the following code,
    >         String url = "";
    >           WDWebResourceType webResType = WDWebResourceType.PDF;
    >            IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);
    >            try {
    >                        url = webResource.getURL();
    >            }
    >  catch (Exception e) {
    >                        e.printStackTrace();
    >            }          
    >            return url;
    Hope It will be helpful
    Regards,
    Sam Charles J.

  • How to include non web pages to the "Create PDF from Web Page" feature?

    In Acrobat Pro (v. 10), when I use the "Create PDF from Web Page" feature, it works great for html pages, but it skips non-html links (doc, pdf, ppt, xls, etc). I need Acrobat Pro to convert those files and put them in the order as well. I don't see an option for this in settings. Is there ANY way I can do this? This is for an archiving purpose and I have 10,000 plus files to convert. Please help.

    This is a question i'm trying to answer too. My issue is that I have a PDF file which itself contains links to both DOC and PDF files. The end result is that I need one consolidated PDF containing all the linked files (in order).
    I can run the "create from web page" on this PDF file, and it'll download them, but not convert them. It just adds them as "jumbled" text to the end of the document. I need it to download, convert, and then append them.
    So, as isunshine3 asked above, any way to have Adobe convert the files that it finds linked when running the "create from web page"?
    THanks
    Matt

  • Passing parameters to Transactions from Web dynpro Application through ITS

    Hi,
    i need to call a transaction from Web dynpro through ITS. On action from web dynpro application, i am concatenating the respective parameters mentioned below along with URL. The problem is one parameter(VARIANT) is being passed to the t-code CAT3 correctly. The next mandatory parameter(PERNR) is not passed to the respective field.Here is the URL Code:
    CONCATENATE 'http'
    '://' host ':' port
    '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'CAT3'
    '%20TCATST-VARIANT=' lv_name2 '&CATSFIELDS-PERNR=' lv_name1 INTO url.
    Called T-Code CAT3
    Passing Parameters are:
    Data Profile TCATST-VARIANT
    Pernr: CATSFIELDS-PERNR

    Pradeep,
    iam trying to pass values from webdynpro application to SAP GUI Transaction
    here is the sample code which iam using
    CONCATENATE  'http://s0164dep01.adta.uae:50000/irj/portal/interop?NavigationTarget=pcd:portal_content/Testing/trn_iw33?'
    '%20CAUFVD-AUFNR='
                 'ApplicationParameter=CAUFVD-AUFNR='
                  lv_workorder';'
              'DYNP_OKCODE=SHOW'
             INTO lv_url.
    i could'nt able to succed as its displaying page not found exception.
    Help me on this to proceed further
    Regards
    Jaipal.E

  • CAF DB Update for CAF Entity Service from Web Dynpro

    Hi all,
    I have created an entity service in CAF called “Contacts’ which contains the following attributes.
    phoneNo
    cellNo
    emailID.
    Another entity service called "Person" is created. This contains the following attributes.
    personId
    personName
    personAddr
    contactsRef. (Cardinality -> 0..n , Relational Type -> Composition)
    That means Contacts entity service is used within Person entity service. Now it is working fine within CAF service browser. Now the Web Dynpro DC of CAF application is used within another custom Web Dynpro DC project. I want to store data from Web Dynpro.
    Within the context of component controller of  Web Dynpro the structure is like
    APerson
         |_ personId
         |_ personName
         |_ personAddr
         |_ contactsRef       
                    |_ phoneNo (Under contactsRef)
                    |_ cellNo (Under contactsRef)
                    |_ emailID (Under contactsRef)
    So I have written the following code within web dynpro custom method.
    APerson person = PersonServiceProxy.create();
    java.util.List ls = new ArrayList();
    for(int i=0; i<4;i++)
    AContacts contact = ContactsServiceProxy.create();
    contact.setCellNo("9092130156");
    contact.setEmailID("[email protected]");
    contact.setPhoneNo("432258");
    contact.getAspect().sendChanges();
    ls.add(contact);
    person.setRelatedModelObjects("contactsRef",ls);
    person.setPersonID("9999");
    person.setPersonName("xyz");
    person.setPersonAddr("ABC, KOL");
    wdContext.nodeAPerson().bind(person);
    person.getAspect().sendChanges();
    CAFServiceFactory.getServiceFacade(idendityDefinition.class);
    After saving the data from Web Dynpro I am trying to test it from CAF service browser. But I am getting only the parent row. I mean only the value of personId, personName and personAddr fields which I have stored from Web Dynpro. But no value is coming within the table for Contacts entity service for composition relation.
    Could anybody help me how can I solve my problem?
    Thanks & Regards
    Chandan
    Message was edited by:
            Chandan Jash

    Hi Chandan,
    Can you do person.getRelatedModelObjects() and get the contact object, to check whether it is null, also check in the CAF DB whether the data you entered is present.
      I am not sure the code is actually adding the contact model object to person.
    Go thru this SDN Blog on usage of the CMI API's, there is a link for CMI documentation in it which might help you get the right code for adding the contact object.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115.
    award points if  info is helpful
    Regards,
    Anish

  • File, create PDF, from web page, entire site...questions

    I am new to adobe, is this the proper forum for Adobe Acrobat 9 Pro for macintosh?  I think yes...
    Created a PDF from:  File, create PDF, from web page, entire site.
    Is there a way to print this without the background color?  If you printed from a browser, you could choose not to print the back ground color.  I know exactly the color.
    Is there a way to make this PDF look like the web, with no page breakes?  I have tried various things, but the page breaks are always displayed.
    Is there a way to create bookmarks on somthing other than the title tag in the web site?  The title tag is an SEO 1 sentence summary of the page, which makes for very long book mark names.
    Thanks for your help.
    bob
    www.answerstat.net

    I don't use v9, but what I would do is click the FILE--PRINT option, print to PDF, and enter to print one page (default is first page)

  • Create PDF from web page w/password

    Would like to created a PDF using the 'Create PDF from WEB Page' function. The initial page of the site requires a login which we have but we seem to be unable to use Acrobat to archive the site because it requires a login. Is there a way to login and create a pdf of the site?

    I tested this in Acrobat X and the exact same issue occurs
    http://www.quantumdynamix.net/clients/image-map-test/ImageMapTest-AcrobatX.pdf
    This has to be considered a legatimate bug, especially since IMAGE MAPS is listes as one of the supported HTML features via the help files

  • Connecting to SAP from Web Dynpro

    Hi,
    I am new to web dynpro, but have downloaded the java sneak preview edition and worked through it a bit. I understand that we have to use JCo to connect to SAP from Java Web dynpro, . Is it true?
    What about web dynpro for ABAP? Can we use normal select statements to connect to SAP? How is it exactly done in that case?
    Thanks in advance
    PG

    hi pg
    Just go thru this example which describes how to connect to SAP from web dynpro application.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on accessing abap functions in web dynpro - 4.htm
    thanks
    kris

  • CAF DB update from Web Dynpro

    Hi all,
    I have created an entity service in CAF called “Contacts’ which contains the following attributes.
    phoneNo
    cellNo
    emailId.
    Another entity service called "Person" is created. This contains the following attributes.
    personId
    personName
    personAddr
    contactsRef. (Cardinality -> 0..n  , Relational Type -> Composition)
    That means Contacts entity service is used within Person entity service. Now it is working fine within CAF service browser. Now the Web Dynpro DC of CAF application is used within another custom Web Dynpro DC project. I want to store data from Web Dynpro. So I have written the following code within web dynpro custom method.
    APerson person = PersonServiceProxy.create();
         java.util.List ls = new ArrayList();
        for(int i=0; i<4;i++)
        AContacts contact = ContactsServiceProxy.create();
         contact.setCellNo("9092130156");
         contact.setEmailID("[email protected]");
         contact.setPhoneNo("432258");
         contact.getAspect().sendChanges();
        ls.add(contact);
         person.setRelatedModelObjects("contactRef",ls);
         person.setPersonID("9999");
         person.setPersonName("xyz");
         person.setPersonAddr("ABC, KOL");
         wdContext.nodeAPerson().bind(person);
         person.getAspect().sendChanges();
         CAFServiceFactory.getServiceFacade(idendityDefinition.class);
    After saving the data from Web Dynpro I am trying to test it from CAF service browser. But I am getting only the parent row. I mean only the value of  personId, personName and personAddr fields which I have stored from Web Dynpro. But no value is coming within the table for Contacts entity service for composition relation.
    Could anybody help me how can I solve my problem?
    Thanks & Regards
    Chandan

    Hi Chandan,
    Can you do person.getRelatedModelObjects() and get the contact object, to check whether it is null, also check in the CAF DB whether the data you entered is present.
      I am not sure the code is actually adding the contact model object to person.
    Go thru this SDN Blog on usage of the CMI API's, there is a link for CMI documentation in it which might help you get the right code for adding the contact object.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cef4f43e-0d01-0010-db84-ede25c874115.
    award points if  info is helpful
    Regards,
    Anish

  • Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9alredy

    Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9 is alredy installed on computer. Is this a 64 bit ossue although I am sure I did not have this problem prior to a replacement hard drive being installed.

    What is your operating system, browser?
    What is the exact message you are getting?

  • Print multiple pdf from web site

    Hello everyone!!,
    I need print multiple pdf from web site (web page) to the local printer o client printer.
    I have investigated : cfexecuted, java code, javascript, but i can't do it.
    The idea is don´t open printer dialog box for to print.
    Thanks.

    It is NOT POSSIBLE (for security reasons) to do silent printing in this way.  (you wouldn't want to visit a web site and have your printer start spewing out page after page of profanity, would you??)
    You can, however, offer the user the choice to print and then have it print.  That can easily be done by embedding JavaScript into the PDF to be printed.  If you have multiple documents, you should merge them together on the server first and then send a single document.

  • Where are files downloaded to on the mac when creating a pdf from web pages?

    where on the mac HD are files downloaded to  when creating a pdf from web pages?
    Im creating web pages from the whole site so creating a large document, so wondered where these fiels are stored on the mac so I can delete when finished as dont want to clog up the hard drive.

    Look at the LiveCycle server products.

  • Automize Create a PDF From Web Page

    I am trying to create PDF's from a list of 100+ web pages / URLs.
    I would like to automize the process as to save me time.
    (I have been doing some research but I am a newbie when it comes to programing / scripting / coding)
    My questions are
    1) Is it possible to write a script to execute Acrobat's Create PDF from Web Page option in order to automize a long list of URLs?
    Something along the lines of .bat file (reading something like)
    acrobat.exe "http://www.google.com" "%CD%\GoogleTest.pfd"
    acrobat.exe "http://www.yahoo.com" "%CD%\YahooTest.pdf"
    2) If it is possible to script / automize Acrobat's Create PDF from Web Page can you lead me to the right direction as to what programs I need to write a script (if any) and any examples of how the script would be written would be extremely helpful
    Thank you for your time

    You can post your question in the forum for Acrobat Scripting or Acrobat SDK.

Maybe you are looking for