MS office control in WD ABAP

Hi,
I want to display the excel with data in webdynpro.
I have data in XSTRING format in node, that i binded to the datasource of MS Excel UI element, I can able to download the xstring to desktop in excel format. but the same xstring i cant able to display in WD UI.
Only excel with blank values are displayed, I checked service pack of SAP, IE Active X control all are fine.
Please help me how to display data in MS office control Excel in WD UI.
Regards
Virkly

Hello,
Please refer to the following sample:* Excel File Upload And Display Data Using Web DynPro ABAP*
Link: [http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP]
Have a look at the source code given in 14 which converts xstring to string.
Hope this helps!
Regards,
Srilatha

Similar Messages

  • Import Data from Office Control (Web Dynpro for ABAP) into internal-Table

    Hello,
    I have a question concerning the Office Control UI-Eelement in Web Dynpro for ABAP:
    How can I import spreadsheet data from the Office Control into  a internal-table?
    I have an Excel-sheet (without any data) which is shown initially in the Office Control. First the empty Excel-Sheet will be loaded and in the second step data from an alvxml-transformation will be loaded into the Excel-sheet with the method 'activatexmlsource'. This works so far. When I change the loaded data in the Office Control and save it it will be stored as XLS-File. The problem is that I'm not able to use existing Upload-FM because every function module I tried uses GUI-functions and WebDynpro has no GUI-functionality. I always get the error that data from clipboard cannot be imported.
    So now the question is:
    How can I import changed data from the Office control into a internal-table staying in Web Dynpro application?
    Please give some advice, if you have some useful code or ideas.
    Thanks
    ram
    Edited by: Ramakullay Challa on Sep 24, 2009 9:05 AM
    Edited by: Ramakullay Challa on Sep 24, 2009 9:07 AM

    Hi,
    Once you save to desktop again you have made some changes to that file, this file you want to upload it right.
    Then in that case you need to use the FILEUPLOAD UI element right.
    Regards,
    Lekha.

  • Import Data from Office Control (Web Dynpro for ABAP) into SAP-Table

    Hello,
    I have a question concerning the Office Control UI-Eelement in Web Dynpro for ABAP:
    How can I import spreadsheet data from the Office Control in a SAP-table?
    I have an Excel-sheet (without any data) which is shown initially in the Office Control. First the empty Excel-Sheet will be loaded and in the second step data from an alvxml-transformation will be loaded into the Excel-sheet with the method 'activatexmlsource'. This works so far. When I change the loaded data in the Office Control and save it it will be stored as XLS-File. The problem is that I'm not able to use existing Upload-FM because every function module I tried uses GUI-functions and WebDynpro has no GUI-functionality. I always get the error that data from clipboard cannot be imported.
    So now the question is:
    How can I import changed data from the Office control into a SAP-table staying in Web Dynpro application?
    Please give some advice, if you have some useful code or ideas.
    Thanks in advance,
    Philipp
    Edited by: Philipp Hiebler on Feb 11, 2008 10:15 AM

    Hi,
    Once you save to desktop again you have made some changes to that file, this file you want to upload it right.
    Then in that case you need to use the FILEUPLOAD UI element right.
    Regards,
    Lekha.

  • Webdynpro Abap Office control problem

    Hi Gurus,
    I'am using the office control to display stored word document and I'm facing the following problem :
    when I visualize a word document from my webdynpropage, I got access to the toolbar menu(print save and all the tools displayed on the top of the control) but once I open another page to visualize another word document I loose the access to the toolbar menu in my first page, but I can do so in my second opened page.
    It seems that I can not use the office control toolbar in multipple document. and once I open a page this feature is disabled on the previews pages.
    any idea please?
    Regards,
    Simo

    Hi
    Try to use thid below code I think it will solve your problem.
    Code for File download in action method
      DATA lr_conv   TYPE REF TO cl_abap_conv_out_ce.
      DATA lv_data   TYPE        string.
      DATA lv_xfile  TYPE        xstring.
      lv_data = 'Example text, which will be opened in MS Word.'.
      cl_abap_conv_out_ce=>create( RECEIVING conv = lr_conv ).
      lr_conv->convert( EXPORTING data   = lv_data
                        IMPORTING buffer = lv_xfile ).
      cl_wd_runtime_services=>attach_file_to_response(
                         EXPORTING i_filename  = 'wd4a.doc'
                                   i_content   = lv_xfile
                                   i_mime_type = u2018applicaton/mswordu2019)
    Thanks & Regards,
    Ravi Kiran.

  • Excel import export using Office Control

    Hi,
    We have the requirement to provide a feature like an excel uplaod and download in our UI (WD ABAP).Basically we have some WD table view and we need to collect all the data in each cell and then download the data in an excel file.Similarly we need to get the data in the Excel and fill the table view with this data from the excel.
    Is this possible through the Office Control?I checked out the examples in SIOS but my impression was that it more or less embeds office objects(excel,word etc) in Webdynpro container,but does not really get the data to be filled in an internal table.Also I am not sure whether I can download data from my WD table view to an excel file using this.
    Can anyone please tell me if there is some way to do this through an office control.If not what are the options available for me to achieve this functionality.
    Thanks and Regards
    Sourav

    Hi Sourav,
    If you use WDP ALV table, it has an 'Export' functionality which will export the contents of the table into an Excel.
    Regards,
    Wenonah

  • Problem in Office Control

    Hi all,
            I am trying to work with office control. I had created a value node called "DocumentSourceNode".
    created a supply function with the name fillNode.. Under fillNode i wrote the following code.
    ISimpleTypeModifiable mod = node.getNodeInfo().getAttribute("DocumentContent").getModifiableSimpleType();
    ModifiableBinaryType bin = (ModifiableBinaryType)mod;
    bin.setMimeType(new WebResourceType("doc", "application/msword", false));
    IPrivateOfficeView.IDocumentSourceNodeElement element = wdContext.nodeDocumentSourceNode().createDocumentSourceNodeElement();
    node.addElement(element);
    String filename = "";
         try
                    filename = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "example.doc");
                    byte[] bytes = getBytesFromFile(new File(filename));
                    element.setDocumentContent(bytes);
         catch (WDAliasResolvingException e)
                    throw new WDRuntimeException("No datasource available: " + filename);
         catch (IOException e) {
                //handle exception
    when i am executing, i am getting this exception....
    catch (WDAliasResolvingException e)
                    throw new WDRuntimeException("No datasource available: " + filename);
    I had stored a msword document say example under mime/applications/com.sap..../example... am i stored the document in a right area? Please help me....

    Hi  aarthi,
                 Thanks for ur suggestion. Since i got error in my catch block i added this lines in the catch block
    catch (WDURLException e)
                    throw new WDRuntimeException("No datasource available: " + filename);
    So i m getting this error,
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: No datasource available

  • What is control tables in abap hr?what is the purpose?

    what is control tables in abap hr?what is the purpose?

    These are the screen elements used to display tabular data they can be called
    as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
    using OK_CODE field.
    Having a parallel loop(at screen table rows & int table rows) by using parameter
    AT int_table makes the ABAP code simple.
    A special structure of type CXTAB_CONTROL is used to set/get various
    attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
    ABAP declaration
    CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
    Here tab_con is the same name we used in screen for the table control.
    This ABAP statement will declare a control variable that will be used to access
    the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
    REFRESH CONTROL tab_con FROM SCREEN nnnn
    This ABAP statement will initialize the table control on the screen nnnn to its initial values.
    PBO processingI
    n PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
    intenal table.
    LOOP WITH CONTROL tab_con.
    MODULE fill_tab_con.
    ENDLOOP.
    Here a module should be called between the loop endloop statement to transfer
    data from th ABAP program to the screen table through a structure.This module
    should use the CURRENT_LINE attribute of the table control variable to get the
    current screen table record index to read the data from the internal table into a work area.
    e.g.
    READ TABLE int_table INDEX tab_con-CURRENT_LINE
    The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
    screen_field_name = int_table-field_name
    LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
    n1 TO n2.
    ENDLOOP.
    Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
    should be the first to display on the table control .FROM n1 TO n2 can be used
    to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
    In both cases before the LOOP statement a module should be called which
    is generally for setting of status ,in which we should fill the LINES attribute
    (tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
    The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
    to get the total lines in an int table.
    PAI Processing
    We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
    call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
    e.g.
    PROCESS AFTER INPUT
    MODULE mod AT EXIT-COMMAND.
    LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
    MODULE modify_int_table.
    ENDLOOP.
    MODULE user_command.
    In the MODULE call modify_int_table we can use
    MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
    or we can use
    int_table-field_name = screen_field_name.
    Thanks
    Please Reward points if helpful.
    Edited by: Richa Khosla on Mar 28, 2008 7:38 AM

  • How to insert an Active X control in a ABAP form

    Hi All,
        I am learner, want to embed an Active X control in ABAP form, and how can i communicate from Active X control to ABAP form. if you refer screen shots it will be great.
    Thanks & Regards
    Chandra

    check this weblog.
    <a href="https://weblogs.sdn.sap.com/pub/wlg/995">Using Classic ActiveX Controls in the ABAP Control Framework</a>
    In future kindly post ABAP related questions in ABAP forum.
    Raja

  • Office Control API is it only for Microsoft office

    Office Control API is it only for Microsoft office or can Star office and open office use the same API.
    IF no please let me know the API used for Star office and open office
    Can anybody provide me with a material of integrating open office and star office to webdynpro java.
    Thanks in advance
    Arulbabu

    Hi Prabkaran,
    You are rt, Its only for Microsoft Office. Prequisites are like below :
    Prerequisites
    "You can only use the OfficeControl UI element if one of the following software programs is installed:
    &#9679;     Microsoft Office 2000, Microsoft Office XP or Microsoft Office 2003
    All Office versions are supported that are currently supported by Microsoft. For details, see http://support.microsoft.com
    If you have Microsoft Internet Explorer installed, check your Internet Options to see whether the ActiveX control elements for executing and initializing are enabled. To do this, choose Internet Options ® Security ® Custom level ® ActiveX controls and plug-ins ® Enable. Otherwise, the Microsoft Word or Excel document cannot be displayed."
    You can go learn more at http://help.sap.com/saphelp_nw04/helpdata/en/5d/a0b16a9d2e4e4d8b2322af6728263f/frameset.htm
    Thanks,
    Raags

  • Hi office control

    hi all,
    i cannot do using office control..
    please call me how about office control(ms_word and ms_excel)???
    how is prepared for office control???
    Reply me soon......
    thanks,
    s.suresh

    Hi,
    for installation prerequisites, see <a href="http://help.sap.com/saphelp_nw70/helpdata/en/43/e86de5008b4d9ae10000000a155369/content.htm">this</a>, and for information on the OfficeControl, see <a href="http://help.sap.com/saphelp_nw70/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm">that</a> and the examples in the system in package SIOS.
    Regards, Heidi

  • 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

  • Office Control: Extract values from Excel sheet

    Hello,
    I would like to extract cell data of the excel office control.
    e.g. I create a excel office control with a plain sheet. The user enters some data (A1=Test).
    How can I extract the data of cell A1?
    the oposite direction (exporting cell data) works in the example IOS_TEST_SPREADSHEET_MS with method
    wd_this->document->activatexmlsource( EXPORTING xml = contentxmlsource
                                                           errorinformation = error_activatexmlsource_stru ).
    but how can I IMPORT the data (after the user has changed it) again?
    Thanks in advance!
    Tobias Horstmann
    Edited by: Tobias Horstmann on Jan 21, 2009 2:12 PM

    Providing you are using a windows based Oracle server and providing the Excel data is formatted as follows:
    Each sheet in the workbook represents a "table"
    The first row on each sheet gives the column names in each column.
    All subsequent rows are the data for those columns.
    You can use Oracle's Heterogeneous Services (HS) to connect to the spreadsheet as external database (via an ODBC datasource).
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMPOr refer to this Article...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4406709207206

  • Office Control Issue

    Dear All,
    I am using Office Control in my WDA. I have created an attribute of type xstring and bound it to the office control element.
    Running the application, I am displayed with a MS word document which is input enabled.
    I have written code corresponding to onSave in which I want to download the contents written in the MS Word document onto my desktop.
    I am unable to do this, and whenever I click on the 'Save' button or do a Ctrl+S, there is some error coming up saying 'CAcfControl: SetControlProperty|Could not find entry for property |HRESULT=-2147467259(Unspecified error)'.
    Please tell me a way around for this.
    Regards,
    Prosenjit.

    Hi,
    Thank you Thomas for your time.
    Before doing that I would like to check the onSave code of mine.
    is it possible to have a sample code for the onSave while using Office_Control.
    Regards,
    Prosenjit.

  • Office control in mobile client 7.1

    Hi all,
    i've included an office control in my mobile application to show a word document. However, when i open my application, i receive following error:
    Fatal HTTP error 500 occured. Connection is closed now.
    The exact error information is logged in
    "C:\Program Files\SAP\SAP Netweaver Mobile
    Client\HTTPError.txt"
    This is the HTTPError.txt file content:
    sessionUrl="//localhost:50080/dispatcher/demo.sap.com~attachorderapp/OrderAttachApp?sessionid=8117667533895423314&amp;sap-wd-cltwndid=6DBFF94EF011DAA000000120E82345C3&amp;sap-wd-appwndid=624B23E69166B08700000120E82345C3&amp;sap-wd-locale=null" xmlns:SAP="SAP"...Localization dateFormat="MM/dd/yyyy" decimalSeparator="." groupingSeparator="," locale="en_BE"/...Client name="SAP-NW-Java" version="7.00" supportBits="6A...Server version="Unknown Version" os="Windows Vista" supportBits="537205"...Exception text="An error has occurred: Failed to process the request. [] " callStack="com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Invalid URL=
    at com.sap.tc.mobile.mwd.runtime.sal.url.URLGenerator.checkURL(URLGenerator.java:340)
    at com.sap.tc.webdynpro.clientserver.uielib.activecomp.impl.AbstractActiveComponent.getArchive(AbstractActiveComponent.java:896)
         at com.sap.tc.webdynpro.clientimpl.scxml.renderer.uielib.activecomp.AbstractActiveComponentRenderer.renderProperties(AbstractActiveComponentRenderer.java:91)
         at com.sap.tc.webdynpro.clientimpl.scxml.renderer.uielib.officecomp.OfficeControlRenderer.renderProperties(OfficeControlRenderer.java:106)
         at com.sap.tc.webdynpro.clientimpl.scxml.renderer.uielib.core.ViewElementRenderer.render(ViewElementRenderer.java:39)
    Do i have to perform certain installations to let the office control work in my mobile client?
    thanks
    Edited by: Peter Vanneste on Apr 27, 2009 5:15 PM
    Edited by: Peter Vanneste on Apr 27, 2009 5:19 PM
    Edited by: Peter Vanneste on Apr 27, 2009 5:23 PM
    Edited by: Peter Vanneste on Apr 27, 2009 5:25 PM

    Hi,
    If you are using the mobile applications for laptops, I am not sure if the JavaGui supports the office control as yet.
    It would be better if you raise an OSS.
    I had tried it a year back I got a UI rendrer problem.
    Thanks and Regards,
    Narayani

  • Problems in Office control

    Hello Everyone,
       I am stuck with a problem using office control.
    The requirement is to display the excel file contents present in the application server to the office control.
    The problem is with reading the contents of the excel file.
    here is the method i used:
      data:
        mime_repository type ref to if_mr_api,
        content type xstring,
        url type string value '/MIG/D/TEST/TEST.xls'.
      mime_repository = cl_mime_repository_api=>get_api( ).
      call method mime_repository->get
        exporting
          i_url = url
        importing
          e_content = content.
    * DATA is binded to the office control contents
      wd_context->set_attribute( name = 'DATA' value = content ).
    The GET method returns a sy-subrc = 3, which means file not found.
    whereas the same code works for another application server with its path.
    Where am i going wrong?  or is there any alternative method to get the content from the file?
    Regards,
    Kinshuk
    Message was edited by:
            Kinshuk Saxena

    Hi Kinshuk,
    I think you should place your file in the exact folder where WDA can recognize, I mean try placing it @ the folder...
    "/SAP/BC/WebDynpro/SAP/PUblic/BC/ssr/uuielibs/office_integration".
    Regards
    Raja Sekhar

Maybe you are looking for

  • ADF: How to highlight cell(s) in chooseDate component

    Hi, I am using "ADF: ChooseDate" component for my application. Based on certain condition(s), I want to highlight a Date/Cell in the chooseDate calendar. I also want to customize the color for certain date (based on some conditions). I could not find

  • Re: ejb

    Todd, there is no sample code available about how to use BeanAdapterModel class. i have implemented in this way: 1. i have created a DataAdapterModel class which extends BeanAdapterModel class. 2. Home object lookup and obtaining remotebean reference

  • 0x3b21 Intellisyn​c Error during Sync Process

    Tried to do a Sync and in DTM under Sync I have these checked: Reconcile Messages Synchronize organizer data (If this is unchecked I DO NOT get this error message) Update device data and time As I watch it go through its Sync screens, right before it

  • Referencing condition values when creating return order is wrong...

    Hello Experts, Lets say I have a billing document that has 3 line items namely material A, B and C. Now, I created a return order for material A with 2 separate line items because of different storage locations. Now, is there a user-exit that lets my

  • Photoshop CS as a non-Administrator

    I recently installed Photoshop CS for a user. After installing, I ran the program without issue. When the user logged in and tried to run it the following error was displayed:      "Current user account does not have privileges to perform product act