Upload and display Word Document in WD application

10-11  Source: Network gathering  Views:9 

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
name = `PDF`
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.
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 ).
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'
tabname = 'ZCM_PSI_SALES'
X030L_WA =
X031L_TAB =
dfies_tab = lt_dfies
not_found = 1
others = 2
if sy-subrc <> 0.
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( ).
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
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!?
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.
Related articles
  • Upload and display Word Document in WD application 10-11

    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 e

  • Store and display word document in database through forms 10-11

    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? regardsHi Alex

  • Upload and Retrieve Word documents 10-11

    Hai friends .. good Morning to all I am fresher i need your help ... Problem What i am Facing: I upload the file and stored in Mysql .. steps what i did to upload the file 1) get the uploaded file and write it into the file InputStream 2) using setBi

  • How to  upload and display image using bsp application 10-11

    hi I  just wants to know that 1- how to  upload image from BSP page with attachment into sap server .? 2-how to display image in to BSP page(webpage). thanksHello Gupta Prashant, Just to upload and display an image, import image in MIME repository. N

  • To upload pdf and ms word document in VA01 header menu -TEXT tab 10-11

    I want to upload local file (PDF and Word) in R/3-VA01-Text Header.. Can any one tell me the solution for that.Can any body tell me how search text in PDF and MS Word document through Java code, any body has code or any suggestion to giveYes. First,

  • How to display word document as a HTML document in portal 10-11

    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 ht

  • Upload and display image in webside 10-11

    Hello Friends, I am developing an auction web site ,and facing some problem so I need your help. There is some confusion about uploading and displaying images in website .In web based application if I want to upload images than where have to store th

  • Display Word Document as read only in VI pannel 10-11

    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

  • How to prevent public users from creating and saving Word Documents 10-11

    I have two public computers available for the public to view legal case documents.  The program used uses the Word shell to save, view and print documents within the program.  The clerk has stated that she does not want attorneys or others to be able

  • Search text in PDF and MS Word document 10-11

    Can any body tell me how search text in PDF and MS Word document through Java code, any body has code or any suggestion to give Thank You AdnanCan any body tell me how search text in PDF and MS Word document through Java code, any body has code or an

  • Read,write and create word document with list data 10-11

    Hi, My requirement is that I have a custom list called List1 and which has a 4 (suppose XName, location, phone, email)columns and also have a Template document(.dot). If I click on save button , new document has to create from the Template document(.

  • Image upload and display from database blob coloumn in ADF 11-30

    HI how can i upload and display image from database ( blob ) coloumn in ADFHi, Take a look to this video: http://www.youtube.com/watch?v=_KYquJwYFGE APRead other 3 answers

  • Uploading and view an document in application server from abap 10-11

    Dear SDN users, I have a similar requirement: i need to upload a docuement into SAP  under a particular system generated unique No. My basis team has given a file path in application server. So i need to upload and view(Not Downloading) that uploaded

  • Displaying Word Document from a Database 10-11

    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 som

  • Upload / Open a Word Document from BDS with WebDynpro 10-11

    Hello, we use the BDS (Business Document Server) to storage our word files. Now we use WebDynpro with the UI OfficeControl. Could any one tell me, how to open/upload my documents from BDS with the OfficeControl. The UI FileUpload does not work, becau

  • Display Word Document in ABAP WebDynpro 10-11

    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

  • How to upload and down load Document from Server in Webdynpro Java 10-11

    Hi, I have to upload and download document to the server and from the server. The examle and the sample application which is available in SDN is not helpful as its about uploading and downloading from the application context.Please let me know how to

  • Display word documents in portal content 10-11

    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

  • Open a MS Word document in portal application 10-11

    In portal content area we can add a MS Word document as an item. When you click the link, portal will launch MS Word and open the file. Can we do the same thing in portal application?Hi friend, Try this simple program... REPORT zawi_try. TABLES: sscr

  • Create Word document in Java application 11-30

    Hi all, Has anybody already used this Java Bean word processing in a Java application: http://www.must.de/default.html?Javactpe.htm ? Is it reliable ?? Any comments are welcome. What are the other ways to read/write a Word document in a Java applicat