How to open a word document in dynpro

Hi experts,
i am new to web dynpro, i have a problem that i need to open a word document from desktop in my screen. its not ALV or i dont have to upload the file but i have to OPEN the file..
plz help
Regards:
Parteek

Hi Manu,
Follow these steps:
1. Create CONTEXT with 2 attributes - UPLOAD & SHOW of type XSTRING.
2. Add a "UPLOAD" element on the layout of screen & map it with UPLOAD attribute of context.
3. Then Add a "OFFICE CONTROL" on the same screen & map it with the SHOW attribute of context..
4. Add a BUTTON for Show Document/Open Document.
5. Add 2 attrubutes in ATTRIBUTES tab of the dynpro application:
        i) DOCUMENT type IF_IOS_DOCUMENT
       ii) FACTORY    type IF_IOS_FACTORY
6. On method of that button (SHOW)...enter the following code:
DATA : refexp TYPE REF TO cx_ios_exception.
IF wd_this->document IS INITIAL.
    wd_this->factory->get_document_proxy( IMPORTING proxy = wd_this->document  ).
    ASSERT ID sios_demo CONDITION wd_this->document IS BOUND.
  ENDIF.
  wd_this->document->opendocument( ).
read context node
DATA:
    node_file_upload                    TYPE REF TO if_wd_context_node,
    elem_file_upload                    TYPE REF TO if_wd_context_element,
    stru_file_upload                    TYPE if_second=>element_file_upload .
navigate from <CONTEXT> to <FILE_UPLOAD> via lead selection
  node_file_upload = wd_context->get_child_node( name = if_second=>wdctx_file_upload ).
get element via lead selection
  elem_file_upload = node_file_upload->get_element(  ).
get all declared attributes
  elem_file_upload->get_static_attributes(
    IMPORTING
      static_attributes = stru_file_upload ).
  stru_file_upload-show = stru_file_upload-upload.
set all declared attributes
  elem_file_upload->set_static_attributes(
    EXPORTING
      static_attributes = stru_file_upload ).
7. Now add the following code to the WDDOMODIFYVIEW method (default method)
  DATA:
      office TYPE REF TO cl_wd_view_element.
get the office control
  office ?= view->get_element( 'OFFICE' ).
  ASSERT ID sios_demo CONDITION  office IS BOUND.
get the IOS interface
  wd_this->factory ?= office->_method_handler.
  ASSERT ID sios_demo CONDITION wd_this->factory IS BOUND.
8. Run the application & enter a text file of word format in the File Upload.
9. Press show button & it will display the code of that word file.
Plz ask any queries if you face any problem doing the above code.
& dont forget to mark Points.
Regards:
Parteek.
Edited by: Parteek Arora on Jan 23, 2008 9:05 AM

Similar Messages

  • How to open a word document

    hi all,
      How i can open a word document containing data by clicking a text in a smart form.
    Thanks,
    Ranjith

    Hi Ranjith,
    Sorry to disappoint You!!
    your requirement cannot be fullfilled as the end product of a smartform is expected to be an printout or at max and PDF document.
    you will not have an option for clicking and you cant achieve your task!!!!!!!!

  • How to open a Word document in LabVIEW

    I would like to open use a Word document as a Help file in my LabView project.  I want it to open when the user clicks on a button.
    From what I have read, using ActiveX commands seems to be the way to do it, but I'm having real difficulty understanding these commands and the examples listed. It is probably quite simple but I just can't get my head around it. 
    Can anyone explain how to do it in simple terms.
    Thanks
    BD

    Hmm.. I only have Office 97 and 2003, so not sure if this will work with Office 2000.  Well, try to open the VI (I saved it to previous version 7.1), and if there are broken wires, do the following (see screenshots):
    1.    right click on Word._Application and go to Select ActiveX Class and Browse (the wording might be different since we're using different version of LabVIEW)
    2.1  it might take a while (a few minutes), but a little window will pop up with all the ActiveX libraries (I think all of them) on your computer.  Select Microsoft Word x.x Object Library.  The one on my computer is from Office 2003, so it's 11.0, I think Office 2000 is 8.0.
    2.2  check the Show Creatable Objects Only box, select Application from the list, and click ok
    3.    If there are still broken wires, go through each property and invoke nodes and reselect the function (functions are slightly different in different version of the library)
    4.   If there are still broken wires, click on the broken arrow and see what's wrong, if the error says something like "contains unwired or bad terminal", double click on the error to go to the problematic node, and create a constant on each empty input (sometimes older version library requires more parameters..)
    Hope this will work...
    See-Ming
    Attachments:
    OpenDoc 7.zip ‏285 KB

  • How to open a word document in safari?

    How do I open a Microsoft Word document on my ipad using Safari?

    I assume that the site is not optimized for iOS/mobile browsers, if that is the behavior that you are seeing. You could try downloading an alternative browser that identifies as a desktop browser like Mercury Browser. There is a free version that I am using right now. You can identify as a desktop browser by tapping the Settings Icon and choosing for User Agent in the lower right corner.
    Perhaps if the site recognizes the browser as a desktop version, it will work for this purpose. If it doesn't work, you have lost nothing but a little bit of time. If it does work and you like Mercury, you can purchase the full version.
    I have the Full version of Mercury, iCab Mobile, Atomic, Dolphin, and Google Chrome which will all identify as desktop browsers.

  • How to open MS word document in browser window?

    Hi all
    Is it somehow acheivable to open a .doc - document in a browser window?
    If I link a .pdf - file from the document library in left navigation menu it opens in a browser window. If I do the same with a MS Word docuemnt it opens the Word application, but I want it to open it inside a browser. Can this somehow be done?
    Regards

    Hi,
    If you want open your document inside Browser, you can try the following settings:
    The setting that controls this behavior is located in Windows Explorer (not Internet Explorer) on the user's machine.
    Open “Windows Explorer”.
    Select Tools -> Folder Options... from the menu.
    Go to the “File Types” tab.
    In the “Registered file types list”, select the file you want to change the setting for (e.g. DOC).
    Click the “Advanced” button to open the Edit File Type dialog.
    There is a checkbox, Browse in same window, where you can specify whether the selected file type should be opened within the browser or launched in its host application when clicked on a web page.
    For more information, please refer to: http://support.microsoft.com/?scid=kb;en-us;162059
    Xue-Mei Chang

  • How to open a Word Document from Developer Forms

    Hi Buddies,
    Can anybody help me out in this regard.
    My requirement is like this.
    In my developer Forms Screen i have one button named resume.
    if i click that button then that particular persons resume has to be opened which is MsWord file(.DOC)located in server(Which is the database server).
    So we have to launch the word with the required document using the Forms built-ins. The document path will be stored in my database.
    Quick response will be appreciated.
    Thanks in Anticipation
    Regards
    Kiran Kumar Jasti

    Hi Kiran,
    host('winword.exe <pass ur resume path>');
    hope this could work out....just try...good luck
    Regards
    Thobula Rakesh

  • How to Open  a Word document using Developer Forms

    Hi Buddies,
    Can anybody help me out in this regard.
    My requirement is like this.
    In my developer Forms Screen i have one button named resume.
    if i click that button then that particular persons resume has to be opened which is MsWord file(.DOC)located in server(Which is the database server).
    So we have to launch the word with the required document using the Forms built-ins. The document path will be stored in my database.
    Quick response will be appreciated.
    Thanks in Anticipation
    Regards
    Kiran Kumar Jasti

    This is a confused and confusing issue. There are no quick fixes. Bear in mind the following points:
    Word is a client program. It can only open documents that can be seen from a client PC. If you cannot see your database server's directories from a client PC (and I would hope you can't) you cannot open that document.
    what you are left with is creating a copy of that document, transporting it to the client realm, and then overwriting it back on the server after your user has finished with it (if they're editing).
    there are many different ways of doing this, but they will probably involve writing an API in VisualBasic or Java. Alternatively you might look at Oracle's IFS.
    This is not the right forum for a detailed solution - try the Developer forum (or IFS if that floats your boat).
    Good luck, APC

  • How to open a word document from OA page

    Hi,
    I have a requirement where in the file names are displayed in a table .When the user clicks on the file name the file should open .The docs are basically word docs.
    Any idea how to implement this.
    I saw a post related to this in which someone suggested to use symlinks in Apache.Not sure how to do that.
    Thanks
    Anna

    Hi Kiran,
    host('winword.exe <pass ur resume path>');
    hope this could work out....just try...good luck
    Regards
    Thobula Rakesh

  • How to open a  Word document in forms

    Hi all ,
    I need to open a document( MS Word) while clicking a button from forms.Will u please help me to do that ?
    Regards,
    Nycy

    CLIENT_HOST will only help you if the file is accessible from the client's filesystem. If you put the documents on the server there are three options:
    1. Transfer the file to the client everytime if should be opened using WEBUTIL_FILE.AS_TO_CLIENT lets say to c:\temp, then open it using CLIENT_HOST as provided by Francois.
    2. Share the directory on the application server to that it can be accessed via UNC-path like \\server\document.doc and use CLIENT_HOST directly on the network dirve
    3. Create a virtual directory in the application server and map it to the physical directory where the doc's are located, then you can access the documents via URL and can use WEB.SHOW_DOCUMENT instaed of CLIENT_HOST.
    hope this helps.

  • How to open a Word document formatted as .wps

    a friend sent an e-mail attachment composed in Word, using template features. It arrived with a .wps file extension. I can't open this, either in pages,keynote or numbers. I tried text-edit also to no avail. I tried changing the file extension to .pages, dragging it into the pages icon and going thru the applications dialog box. Any suggestions?

    epalaw,
    I'm pretty sure that a .wps extension indicates a file that was created in Microsoft Works, not Word -- and that can't be opened in Pages. Your friend needs to re-save it in Word, RTF, or text format.
    -Dennis

  • Opening PC WORd documents with AW

    I am new IMAC user. Unfortunately salesman (Best Buy) told me that a word processor and spread sheet were part of the software package! I want to buy AW (sounds like a great program and my son loves it), but need to know how to open PC Word documents from email. Will I be able to do this?
    Thanks.

    As Roger said, AppleWorks may not open newer Word & Excel files, from a PC or Mac. In the past, AppleWorks 6 was able to open almost all Word & Excel documents, it is not able to open those saved with newer versions of either Mac or PC application. The Office translators in AppleWorks were introduced in late 2000 or early 2001 & have not been updated. In the meantime, Microsoft has made significant changes in the file formats in the last year or two that AppleWorks can't open them any more. AppleWorks 6 was released in March, 2000, & hasn't even had any kind of update since January, 2004.

  • I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    The template is a document in itself, it is not applied to an existing document whether it is a Pages document or a Word document converted to a Pages document.
    You would need to either copy and paste content, using existing styles, or apply the styles to the converted Word document.
    You can Import the Styles from an existing document and those imported Styles can be used to override the current document's styles:
    Menu > Format > Import Styles
    The process is simplified if the styles use the same names, otherwise you will need to delete the style you don't want and replace it with the one that you do want when asked, then the substitution is pretty straightforward.
    Peter

  • HT202879 how can I open a Word document in Pages 09?

    How can I open a Word document using Pages 09 please? I am trying to open Word documents from a CD using both trying to open in Pages, nd dragging and dropping into the Pages icon in the dock. It tells me, every time, thast the document cannot be opened.

    What happens if you open it in TextEdit or LibreOffice [free]?
    Does it open where you got it from?
    Peter

  • How do I open a WORD document which is password protected?

    I need to open a word document, which is password protected.  I can't even get to a page that'll allow me to put in the password!!!  Can anyone advise how I can do this?
    Thanks.

    Hi JoeyR.
    Thanks for your reply.
    I get the following message when I try to open the document: "The Word document is password protected and can’t be imported".
    I've looked at the Open Office software, as you suggested, but it seems confusing.  I'll give it a try, though, as I'm wasting too much time!
    Fingers Crossed!

  • Every time i open a word document ALL my word documents open as separate windows. Same with PowerPoints. How do i fix this?!

    every time i open a word document ALL my word documents open as seperate windows. Same with powerpoints. How do I fix this? Its getting really annoying.

    If you are using Apple's Mail app, whichever os you have, post in its os/Mail forum area.

Maybe you are looking for