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

Similar Messages

  • 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!

  • OLE - Creating header and footer in Word document using abap

    Hi All,
    I'm using OLE to create a WORD document from abap.
    I need to insert a logo in the header and a footer text.
    Does any one know how to insert a header/footer with abap ole ?
    I tried to insert the logo as picture with:
    call method of o_inlineshapes 'AddPicture' = o_logo
      exporting
      #1 = 'C:\logo3.jpg'.
    but I can't put it in the place I want..
    thanks,
    Michal

    call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
    call method of lobj_activewindow 'ActivePane' = w_activepane.
    call method of lobj_activepane 'View' = w_activeview.
    SET PROPERTY OF w_activeview 'SeekView' = '9'.   " header view.
    " This will set the view to the header view. Whatever you write here
    will go to the header.
    Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
    CALL METHOD OF w_selection 'TypeText'exporting
      #1 = 'Rahul Anand'.
    "Now set the view again to the main doc view.
       SET PROPERTY OF w_activeview 'SeekView' = '0'.
    " Now write your main doc code .
    " For footer the view is '10'.
    call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
    call method of lobj_activewindow 'ActivePane' = w_activepane.
    call method of lobj_activepane 'View' = w_activeview.
    SET PROPERTY OF w_activeview 'SeekView' = '9'.   " header view.
    " This will set the view to the header view. Whatever you write here
    will go to the header.
    Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
    CALL METHOD OF w_selection 'TypeText'exporting
      #1 = 'Rahul Anand'.
    "Now set the view again to the main doc view.
       SET PROPERTY OF w_activeview 'SeekView' = '0'.
    " Now write your main doc code .
    " For footer the view is '10'.

  • How to display word document as a HTML document in portal

    Hi
    I developed a portal application in that i am displaying word document using IFrames, from my application i am uploading word document and saving those document in KM
    Requirement is that i need to provide an option to show this word document in html.
    Thanks
    Rudradev.

    Hi Glenn Mendonca
    I thing it is possible
    Even in SDN search results page, we have option called "HTML version" link
    to see the search document in HTML
    see the below url
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2fforums%2fsdn_forums%2fthread%7b74687265616449443d39313633%7d.jspa
    i hope passing doucment as a query parameter to com.sap.km.cm.highlightedcontent?DocumentUri=
    might solve this
    pls give your inputs
    Thanks

  • Display Word Document as read only in VI pannel

    In a VI pannel I put an Active X container with the IE browser to display Word documents.
    The document are displayed properly but I want not give the user the possibility to make changes while viewing.
    Is there a solution to do so?
    (The documents are read-only and can not be saved.)

    Why use an IE container to display Word documents? You can place a word document directly in the ActiveX container. This seems a better choice.
    If you wish to totally block user-input, you can place a transparent picture control over the display of the Word document.
    Another alternative would be to convert the word document to a PDF and show this in an AcviteX container.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Displaying Word documents on web using IFS

    I am trying to display word documents stored in IFS on the web using the IFS Java API. The process we are currently using is outlined as follows :
    1. Connect to IFS using the connect() method of LibraryService class.
    2. Obtain references to IfsFileSystem object and PublicObject (using findPublicObjectbyPath() method of IfFileSystem class).
    3. Cast the PublicObject to Document class.
    4. Obtain a reference to the InputStream using the getContentStream() method of Document class.
    Now, how do we display the contents of this document on the web ? Is there any IFS classes that do this for us or do we have to rely on the Java I/O classes to read the InputStream char-by-char and display the file ?
    Thanks

    If you are trying to retrieve binary content through a customer Web client, you wouldn't write it to the browser - since the browser can only display HTML.
    Instead, you would generate a Web page which includes a URL to the document (e.g. http://ifsserver/:81466, or http://ifsserver/public/mydoc.doc). Subsequently, when a user clicks the URL, the browser will request the document directly from Oracle iFS' http server. When the http protocol server returns the document content, the browser will determine its MIME type, and launch the appropriate viewing application or helper application automatically.
    null

  • Upload and display Word Document in WD application

    Hello,
    I have a WD ABAP appl. where the user wants to upload an Word / Excel file (from its own local drive).
    The document shall be saved in SAP and it shall also be possible to display the document later in the WD application.
    I implemented the UI element upload in the view, to determine the path of the document.
    For the display implemented the UI element Office control.
    1. When i browse the document, the properties data, filename and mime type are filled into the bound context elements of the upload UI.
    2. The property datasource of the UI office control I bound to the same context element, that is also bound to the property data of the upload UI.
    The office control opens a word document, but the document is empty.
    Is it possible that the document is not uploaded correct?
    In another application I did an upload for a PDF doc.. There I implemented the following coding as action of the button 'Upload'.
    data lo_nd_pdf type ref to if_wd_context_node.
    data lo_el_pdf type ref to if_wd_context_element.
    data ls_pdf type wd_this->element_pdf.
    data lv_pdf like ls_pdf-pdf.
    navigate from <CONTEXT> to <PDF> via lead selection
    lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    get element via lead selection
    lo_el_pdf = lo_nd_pdf->get_element( ).
    get single attribute
    lo_el_pdf->get_attribute(
    exporting
    name = `PDF`
    importing
    value = lv_pdf ).
    Get a reference to the from processing class.
    data: l_fp type ref to if_fp.
    l_fp = cl_fp=>get_reference( ).
    Get a reference to the PDF Object class.
    data: l_pdfobj type ref to if_fp_pdf_object.
    l_pdfobj = l_fp->create_pdf_object( ).
    set the pdf in the PDF Object
    l_pdfobj->set_document( pdfdata = lv_pdf ).
    set the PDF Object to extract data the Form data.
    l_pdfobj->set_extractdata( ).
    execute call to ADS
    l_pdfobj->execute( ).
    get the PDF Form data
    data: pdf_form_data type xstring.
    l_pdfobj->get_data(
    importing
    formdata = pdf_form_data ).
    convert the xstring from data to string so it can be processed using the iXML classes
    data: converter type ref to cl_abap_conv_in_ce,
    formxml type string.
    converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).
    converter->read(
    importing
    data = formxml ).
    pull in the iXML type group.
    type-pools: ixml.
    get a reference to iXML object
    data:l_ixml type ref to if_ixml.
    l_ixml = cl_ixml=>create( ).
    get iStream object from StreamFactory
    data: streamfactory type ref to if_ixml_stream_factory,
    istream type ref to if_ixml_istream.
    streamfactory = l_ixml->create_stream_factory( ).
    istream = streamfactory->create_istream_string( formxml ).
    create an XML document class that will be used to process the XML
    data: document type ref to if_ixml_document.
    document = l_ixml->create_document( ).
    create the parser class
    data: parser type ref to if_ixml_parser.
    parser = l_ixml->create_parser( stream_factory = streamfactory
    istream = istream
    document = document ).
    parse the XML
    parser->parse( ).
    define XML Node type object
    data: node type ref to if_ixml_node,
    attributes type ref to if_ixml_named_node_map.
    get the psi sales data Node and value.
    data ls_psi_sales type wd_this->element_psi_sales.
    data: lt_dfies type table of dfies,
    ls_defies type dfies.
    call function 'DDIF_NAMETAB_GET'
    exporting
    tabname = 'ZCM_PSI_SALES'
    ALL_TYPES = ' '
    LFIELDNAME = ' '
    GROUP_NAMES = ' '
    UCLEN =
    IMPORTING
    X030L_WA =
    DTELINFO_WA =
    TTYPINFO_WA =
    DDOBJTYPE =
    DFIES_WA =
    LINES_DESCR =
    tables
    X031L_TAB =
    dfies_tab = lt_dfies
    exceptions
    not_found = 1
    others = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    data: lv_fieldname type string.
    field-symbols <fs_field> type any.
    loop at lt_dfies into ls_defies.
    lv_fieldname = ls_defies-fieldname.
    node = document->find_from_name( name = lv_fieldname ).
    assign component lv_fieldname
    of structure ls_psi_sales
    to <fs_field>.
    if <fs_field> is assigned.
    <fs_field> = node->get_value( ).
    endif.
    endloop.
    WRITE DATA INTO CONTEXT
    data lo_nd_psi_sales type ref to if_wd_context_node.
    data lo_el_psi_sales type ref to if_wd_context_element.
    navigate from <CONTEXT> to <PSI_SALES> via lead selection
    lo_nd_psi_sales = wd_context->get_child_node( name = wd_this->wdctx_psi_sales ).
    get element via lead selection
    lo_el_psi_sales = lo_nd_psi_sales->get_element( ).
    set all declared attributes
    lo_el_psi_sales->set_static_attributes(
    exporting
    static_attributes = ls_psi_sales ).
    Do I need such a code also to upload a word doc?
    Which interface / class exists for word documents? (for PDF upload there is the interface IF_FP)
    How can I save a document in SAP? (as MIME Object?  with which method?)
    I hope someone can help me!?
    BR

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • Displaying Word Document from a Database

    Let me try to explain this.
    I can upload and store a Word Document in an Oracle database
    (BLOB column) but now I need to extract that Word document and
    place a pointer to it on the Web. Can someone explain to me how
    this is done?
    I'm trying to do something like have an image displayed on
    the Web and when you click on it the Word Document is opened.
    Follow me on that? So, if there are 15 Word documents in the
    database, then the web page would have 15 images all pointing to
    each separate Word document.
    Has anyone done this?

    Don't take my word on this, but I think this should work;
    I've done this in the past to send dynamically-generated CSV files
    to the user, which is in a way (at least at the perspective of
    what's being outputted to the user) the same thing.
    First, obviously, you need to retrieve the Word document data
    from the database. We'll say you put that in a variable called
    'wordDoc'.
    <cfset wordDoc = someQuery.wordDataObj />
    Next, we need to set the 'Content-disposition' HTTP header,
    to tell the client's browser that we're sending a file, and that we
    want you to call it somefile.doc by default. We'll do this with the
    <cfheader> tag (note that if you use <cfflush> in the
    application, this tag (and thus, this approach)
    will not work.
    <cfheader name="Content-disposition" value="attachment;
    filename=somefile.doc" />
    Almost there. Now we need to set the Content-type HTTP
    header, to tell the browser what kind of data is coming, and then
    give it the actual file data. We'll use the <cfcontent> tag
    to do both of these things.
    <cfcontent type="application/msword"
    reset="yes">#wordDoc#</cfcontent><cfabort>
    If memory serves, this should be all you need. Note the
    <cfabort> after the closing <cfcontent> tag, I've had
    problems in the past with additional output on the page after these
    tags being appended to what gets sent to the browser, so I use a
    <cfabort> afterwards to make sure nothing more gets sent
    after the data we want. Also, at least with CFMX7, I've noticed
    that debugging output tends to get added in too regardless, so I
    typically put a <cfsetting showdebugoutput="false" /> at the
    top of the file, too.
    I can't guarantee this will work, I haven't tested this
    particular situation, but if it doesn't, it ought to be close. Let
    me know if I'm wrong.
    Attached is what should be the code without my commentary /
    rambling interspersed.

  • How to display HTML files using ABAP Webdynpro?

    Hi,
    I have a html index file and a bunch of other files accessed by the index file  in a specific directory on the SAP server. I'd like to display the index file via ABAP webdynpro and allow the users to click on what they need to see. How can I achieve this using utilizing the ABAP webdynpro technology ?
    Thanks!

    Hi Thomas,
    Thanks for taking the time to answer my question.
    I have the main html file and all other files needed by the main file in one directory on the application layer of SAP. I'd like to provide the user with a link, by clicking on which they should be able to get to the main html file using the browser. This is just a standalone application.
    I can try the approach using BSPs, however, I'm new to that area. Could you point me in the right direction to get started?

  • Using OLE add Header to MS Word Document in ABAP Program

    Dear Friends,
    I have a requirement where I want to add Header and Footer to MS Word through OLE in ABAP Program
    I am able to open the word document, through OLE,
    I am stuck @ the following step.
    CALL METHOD OF LO_APPLICATION 'ActiveDocument' = LO_DOCUMENT.
      IF SY-SUBRC <> 0.     EXIT.   ENDIF.
      CALL METHOD OF LO_DOCUMENT 'Sections' = LO_SECTIONS.
      IF SY-SUBRC <> 0.     EXIT.   ENDIF.
    Please let me know.
    Thanks
    Rajesh

    Hi Rajesh,
    You have to use GET PROPERTY & SET PROPERTY  attributes of OLE2_OBJECT to use headers.
    Just a sample code snippet for your reference :-
    DATA : GS_TABLE TYPE OLE2_OBJECT ,
          GS_RANGE TYPE OLE2_OBJECT,
         GS_CELLTYPE OLE2_OBJECT,
    CALL METHOD OF GS_TABLE  'Cell' = gs_cell
       EXPORTING #1 = '1'
                         #2 = '1'.
       GET PROPERTY OF gs_cell 'Range' = gs_range.
       SET PROPERTY OF gs_range 'Text' = 'VGUID'.
       CALL METHOD OF gs_table 'Cell' = gs_cell
       EXPORTING #1 = '1'
                         #2 = '2'.
    For more details search on SCN for code on creating MS word document using OLE automation.
    Regards
    Abhii

  • Display word documents in portal content

    Hi,
    I have some word documents, which i want to display directly in the portal page. To display the documents I have generated a URL for each document and put this URL into an URL iView.
    But the problem now is, that it always opens a separate window for the word documents, although I have set the property "Open in portal content" in the iview and "Isolation Method - Embedded" in the portal page.
    Does somebody know, which additional settings are needed, to show the documents embedded in the portal page?
    Thanks in advance!
    Regards,
    Lydia

    Hi Lydia,
    The  "Isolation Method - Embedded" will NOT help at all in your case, the "Open in the portal content area" means that
    the iView itself will be opened in the portal content area, instead of a new windows.
    In your case, I agree with Raghu that you should use KM Document iView instead of URL iview, so please consider:
    1. createa separate KM document iViews for every DOC, make sure "Open in the portal content area" is set.
    2. craete a workset and assign the KM Document iViews to this workset
    3. assign this workset to a certain role and assign the role to your user.
    4. login with this user and try to launch the iview, then the DOC file should be opened in the same browser window
    Thanks and best regards,
    Thunder
    Edited by: Thunder Feng on Nov 19, 2010 2:07 AM

  • Store and display word document in database through forms

    how can i store a word document in database through forms 6i or 10g, and display it through forms from database.
    i know how to store a binary file in database through DBMS_LOB package, but i want to do it throug forms. is it possible?
    regards

    Hi Alex
    "Create a datablock and specify the item datatype as blob"
    BUT: How to bring the document to the blob?
    Hi user 611..
    Warning: It is easy if you use an OLE-Object - but OLE is a special format. The result will not be the same as with dbms_LOB.
    We have a application with documents stored via OLE - terrible!
    OLE is no longer supported by forms 10. But webutil would help.
    I asked a similar question and got a good answer:
    OLE-Container and migration to the web
    Wolfram

  • Display Word-document in TextPane ?

    Is it possible to display a word-document in a JTextPane ?
    If yes,how can it be done ?
    thanx.

    You have to code a class that parses a Word doc file,
    and then returns the text and the attributes that the
    TextPane supports (which I think is only text).Hi,
    you can have all the styles in a JTextPane the Class StyleConstants supports if you use a DefaultStyledDocument it it and setup the styles in a SimpleAttributeSet with the methods of class StyleConstants. To insert styled text in the JTextPane use the insertString(...)-method of it - there you can pass string and SimpleAttributeSet.
    You can use this styles during editing too by the setParagraphAttributes(..)-methode resp. the setCharacterAttributes(...)-method.
    greetings Marsian

  • Office Control does not display word document

    HI all,
    I followed the example code to display a word document in the office Control UI, but the display remains blank when I push the button to 'show document'.
    I do not have MS Office installed on the server so I have a wordpad named example.doc on the C drive. Can I read the data from wordpad and display it on the Office Control?
    Thanks
    Jay.

    > Thanks all,
    > I have Office 2003 installed on the client but not on
    > the server. The bytes[] array gets loaded with the
    > string '[B@10e770f', but the display stays empty.
    >
    > Jay
    Hi Jay,
    I need to use this feature as well. Did you get it to work. Can you display and edit a Microsoft Word document from within a browser page. It would be good to know that you have been successful.
    Jesse

  • Inconsistent Behavior When Displaying Word Document

    I use the following code to display an OrdDoc object on a web page using a servlet. When the object is a Word document and it is being displayed for the first time, the Word application handles the document. The second time it is displayed, the IE browser plug-in handles the document. Can you tell me why this is so? How can I get the Word document to just display in the IE browser everytime? Image objects are consistently displayed in the browser. Thank you.
    OrdDoc ordDoc = (OrdDoc)rset.getORAData(1,(ORADataFactory)OrdDoc.getORADataFactory());
    OrdHttpResponseHandler handler = new OrdHttpResponseHandler(actionRequest.getHttpRequest(),actionRequest.getHttpResponse());
                   handler.sendDoc(ordDoc);

    The ORDDoc type will not be able to recognized the WORD document and set the mimetype attribute correctly. Thus when you populate the object you should set the mimetype attribute yourself using the setMimeType() method of ORDDoc.
    When the object is fetched and sent on by the HttpResponseHandler, the handler will use the mimetype setting to set that field in the Response header. This should help browsers to handle the content correctly.

Maybe you are looking for

  • Error 2738-can't uninstall Quicktime

    I am getting this error when I try to uninstall Quicktime. I tried to update to latest version and received this error as well. Until Quicktime is properly installed, I cannot install Itunes. I tried installing Itunes with Quicktime and get the same

  • JDBC datasoure that works for embedded OC4J server of JDeveloper 10.1.3.4

    Hi all, I have this in the Application Module as JDBC datasource: java:comp/env/jdbc/DBCON That works fine if I deploy the application on Oracle application- or tomcat-server. On the connections tab in JDeveloper I have made a database connection wit

  • Windows XP and Boot Camp

    Hi I hope someone can help me because I think I am going to go mad. Basically I want to play Microsoft Flight Simulator 2004 on my 2011 Macbook Air via Boot Camp. I am a bit unsure on how to use boot camp, do I need to download the latest windows sup

  • How do you remove pref file to perform clean install on Firefox for android?

    Uninstallling Firefox on android does not remove the pref file thus does not allow clean install. I have also been unable to find any way to reset everything to default. Both Firefox and beta do nothing but crash and will not even load a full web pag

  • Need Help With getResource()

    I have read the API and I know how to use this but I don't know how to resolve this specific task. I have a .jar file that has a structure like this: net    /pixwerks             /oejb                  /Main.class oejb     /input.txtHow can I open in