Desktop office integration : Creating and filling tables in a word document

Hi all,
I want to create a table in a word document and then fill it with data. The word processor interface has only 'insert_table' methods which can download the data in an ABAP internal table to an already
existing table in a word document, but in my case I also want to create the word table,  titles etc. in the word document. Has someone experience with such kind of a requirement or have someone an example for it? 
Kind Regards,
Sükrü

Hi,
May this one will help you.
CREATE OBJECT wordapp 'Word.Application'.
CALL METHOD OF wordapp 'Documents' = documents.
CALL METHOD OF documents 'Add' = thisdoc.
CALL METHOD OF thisdoc 'Activate'.
GET PROPERTY OF wordapp 'Selection' = selection.
SET PROPERTY OF wordapp 'Visible' = 1.
CALL METHOD OF selection 'TypeParagraph'.
CALL METHOD OF selection 'TypeText'
  EXPORTING #1 = 'New Document'.
GET PROPERTY OF wordapp 'Tables' = tables.
CALL METHOD OF tables 'Add' = thistable.
SET PROPERTY OF thistable 'NumRows' = 2.
SET PROPERTY OF thistable 'NumColumns' = 2.
or you can check
CALL METHOD OF wordobj 'TABLEINSERTTABLE'
EXPORTING
#01 = 2
#02 = 3.
aRs

Similar Messages

  • SAP Desktop Office Integration - Want to place an image in word

    Hello experts!
    I´m faced with an issue using the desktop office integration. I´ve a program which generates a word document and fills out some tables with information from the SAP system. Now I have to place an image as well. The image depends on the users input parameters. So it is not possible to place the image in the template.
    After a short research I found the possibility to do it via using the link server. Or do you think there is a better alternative???
    My problem is that I don´t know how to use and implement it. I did it with the guide BCCIOFFI, but it doesnt work fine.
    Actually, I didnt understand the exact benefit of the link server possibility.
    I have a defined place in the word document and the requirement is to place the image there. The image comes from the SAP system.
    I hope that you can help me to solve the problem.
    Best Regards,
    Marcus

    Hello,
    I did it and it works fine!
    But I had to use the BDS Business Document Service with Class cl_bds_document_set.
    So I used the method "get_with_url" to get the url from the document/picture.
    After that I cann add a binary item with the URL and it works fine if my pictures are stored in BDS.
    But that is not what I want to do. I want to store the pictures in my mime repository for example. Are there any other possibilities to do that? Or is Desktop Office Integrations supporting just documents/pictures which are stored in BDS???
    Regards, Marcus
    Edited...........................................................
    In best case I am able to user internet urls for the pictures. So "http://www.xcxy.de/picture.jpeg", but with this URL information it doesn´t work!
    So, my question is if I have to add a prefix or something like this in order to use weblinks.
    Edited by: Marcus Findeisen on Apr 19, 2011 9:16 AM

  • Desktop Office Integration and Email

    Dear Colleagues:
    I have developed a Desktop Office Integration application that retrieves WORD documents from a BDS Content Server, customizes the document with BP data, emails the document to the BP as an attachment, and associates the document with the BP (Document tab).  It works well.
    I am now trying to figure out how to process the document and use the text as the body of an email message instead of an attachment - I cannot assume that all email recipients use MS Word.
    I have tried several FMs that convert raw data to either strings or RTF format but, inspite of my efforts, I get conversion errors.
    If anyone has tried something similar I would appreciate any advice.
    Regards,
    Steve

    hi.
    i dont know if this will be useful to you. because i did not not understand your exact requirement. are you using OAOR tr code?
    You mean to say you want to  a word document which was uploaded through bds document navigator.
    The code given below actually searches for a string and replaces all occurences of it with a new string..
    IF old_search_string ne search.
           get number of document characters.
            GET PROPERTY OF document_cntl_handle-obj
                           'characters' = ocharacters.
            GET PROPERTY OF ocharacters 'count' = char_count.
            char_position = 0.
            old_search_string = search.
          ENDIF.
        set range now
         IF char_position >= char_count.
            char_position = 0.
          ENDIF.
                CALL METHOD OF document_cntl_handle-obj 'Range' = orange
          EXPORTING #1 = char_position #2 = char_count.
        search now
          GET PROPERTY OF orange 'Find' = ofind.
          IF not replace is initial.
           DATA: is_available type i.
           CALL METHOD proxy->has_wordprocessor_interface
               IMPORTING is_available = is_available
                         retcode      = retcode.
           IF is_available = 1 .
              CALL METHOD proxy->get_wordprocessor_interface
                           IMPORTING wp_interface = wp_ref
                                     retcode = retcode.
               IF RETCODE EQ C_OI_ERRORS=>RET_OK.
                  CALL METHOD wp_ref->replace
                           EXPORTING replace_string = replace
                                     search_string  = search
                                     pos            = 'GLOBAL'
                                     flag           = 'ALL'.
                ENDIF.
            ENDIF.
                  ELSE.
    *search
            CALL METHOD OF ofind 'Execute'
              EXPORTING  #1 = search       "FindText
                         #2 = false        "MatchCase
                         #3 = false        "MatchWholeWord
                         #4 = false        "MatchWildCards
                         #5 = false        "MatchSoundsLike
                         #6 = true         "MatchAllWordForms
                         #7 = true         "Forward
                         #8 = '1'          "Wrap
                         #9 = true.
            GET PROPERTY OF ofind 'Found' = string_found.
            IF string_found > 0.
              GET PROPERTY OF orange 'Font' = ofont.
              GET PROPERTY OF ofont 'ColorIndex' = color_index.
              IF color_index ne 6.
                color_index = 6.
              ELSE.
                color_index = 11.
              ENDIF.
              SET PROPERTY OF ofont 'ColorIndex' = color_index.
            ENDIF.
            GET PROPERTY OF orange 'End' = char_position.
          ENDIF.

  • Need help with Desktop Office Integration (DOI)

    Hi all,
    i need help to read an Excelsheet into an int. table.
    Its the first time, that i use the SAP DOI. I copy different coding into my Report to get connection to an existing Excelsheet.
    Here is my Coding:
    * first get the SAP DOI i_oi_container_control interface
      CALL METHOD c_oi_container_control_creator=>get_container_control
                        IMPORTING control = gr_control
                                  error   = gr_errors.
      APPEND gr_errors.
    * create a control container as defined in dynpro 100
      CREATE OBJECT gr_container
                EXPORTING container_name = 'CONTAINER'.
    * initialize the SAP DOI Container, tell it to run in the container
    * specified above and tell it to run Excel in-place
      CALL METHOD gr_control->init_control
        EXPORTING
          r3_application_name      =    'Data'
          inplace_enabled          = ' '
          inplace_scroll_documents = 'X'
          parent                   = gr_container
          register_on_close_event  = 'X'
          register_on_custom_event = 'X'
          no_flush                 = 'X'
        IMPORTING
          error                    = gr_errors.
    * save error object in collection
      APPEND gr_errors.
    * ask the SAP DOI container for a i_oi_document_proxy for Excel
      CALL METHOD gr_control->get_document_proxy
                           EXPORTING document_type = 'Excel.Sheet'
    *                       EXPORTING document_type = 'Word.Document'
                                    no_flush = 'X'
    *                                REGISTER_CONTAINER = 'X'
                          IMPORTING document_proxy = gr_document
                                    error          = gr_errors.
      APPEND gr_errors.
    Then i open the Document from lokal PC.
    CALL METHOD gr_document->open_document
          EXPORTING
    *      document_title   = ld_filenc
            document_url     = ld_verzc
    *      NO_FLUSH         = ' '
    *      OPEN_INPLACE     = ' '
    *      open_readonly    = ' '
    *      PROTECT_DOCUMENT = ' '
    *      STARTUP_MACRO    = ''
    *      USER_INFO        =
    *      ONSAVE_MACRO     =
          IMPORTING
            error            = gr_errors
    *      RETCODE          =
      APPEND gr_errors.
    Now i start the spreadsheet interface:
    *...check if our document proxy can serve a spreadsheet interface  data:
      DATA: pd_has TYPE i.
      CALL METHOD gr_document->has_spreadsheet_interface
                        EXPORTING no_flush = 'X'
                        IMPORTING is_available = pd_has
                                  error = gr_errors.
      APPEND gr_errors.
      CALL METHOD gr_document->get_spreadsheet_interface
                        EXPORTING no_flush = ' '
                        IMPORTING
                                  sheet_interface = gr_spreadsheet
                                  error = gr_errors.
      APPEND gr_errors.
    * now loop through error collection because
    * Get_spreadsheet_interface flushed and synchronized
    * the automation queue !
      LOOP AT gr_errors.
        CALL METHOD gr_errors->raise_message
                        EXPORTING  type     = 'I'
                        EXCEPTIONS message_raised = 1
                                   OTHERS         = 2.
        IF sy-subrc = 1.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          pd_kz_fehler = 'X'.
          EXIT.
        ENDIF.
      ENDLOOP.
      FREE gr_errors.
    Ok, now i can open a Excelsheet, and i can mark a range in the sheet
    rows is a constant.
    CALL METHOD gr_spreadsheet->set_selection
          EXPORTING
            left     = 1
            top      = 2
            rows     = rows
            columns  = 18
    *    NO_FLUSH = ' '
    *    UPDATING = -1
        IMPORTING
          error    = gr_errors
    *    RETCODE  =
    my first problem: Excel is really open, and the user can see the sheet. I dont want, that excel is visible...is there a way to start excel in no_visible mode?
    second problem: The sheet have makro aktiv...at start from excel, there is a popup, which ask 'makros activate' oder not activate...  i dont want this popup... is there a way, to say it from abap, that makros always active?
    third problem: i see, that the content Table have this components:
    TYPES: BEGIN OF SOI_GENERIC_ITEM,
             ROW(4) TYPE C,
             COLUMN(4) TYPE C,
             VALUE(256) TYPE C,
           END OF SOI_GENERIC_ITEM.
    But my excelsheet have more then 10000 lines....
    forth (and biggest) problem: i need the selected data into an int. tabelle. The table have the components:
    ROW
    COL
    VALUE
    i dont know, how can i do this...
    please help me
    Sorry for my bad english.
    Greetings
    Markus

    Hi,
    May be this link is useful
    /people/thomas.jung3/blog/2005/05/11/using-classic-activex-controls-in-the-abap-control-framework
    Also Check out report SAPRDEMOEXCELINTEGRATION2.
    check the links
    http://www.esnips.com/doc/741a848e-f49a-4436-bec4-e21950f6c94c/desktop-office-integration.pdf
    http://www.esnips.com/doc/2080a9ec-64f9-49c4-bd03-d9f56bc2437c/MSWord--Excel-with-ABAP.pdf
    Regards,
    Raj.

  • Desktop Office Integration in SAP GUI for HTML - dont works?

    Hello all,
    my program reads an Excel-File with multiple Worksheets into SAP by using class:
    CL_GUI_CUSTOM_CONTAINER
    and intefaces:
    I_OI_CONTAINER_CONTROL,
    I_OI_DOCUMENT_PROXY AND
    I_OI_SPREADSHEET.
    All works fine, but when I integrated the SAP Transaction into our Portal and using the Program through the WEBGUI it dont works.
    It looks like that he can't create a container Control, to open the File in Background in Excel.
    I worked with Desktop Office Integration to read all Worksheets into SAP, like here:
    http://abap-explorer.blogspot.com/2008/12/upload-data-from-multiple-worksheets-of.html
    Is there any solution to solve my problem?
    it returns me this message
    "Cannot initialize control"
    It seems that the error comes from this Method in Webgui:
    Data iref_document    type ref to i_oi_document_proxy.
      call method iref_document->open_document
        exporting
          document_title = 'Excel'
          document_url   = v_document_url
          open_inplace   = 'X'
        importing
          error          = iref_error.
      if iref_error->has_failed = 'X'.
        call method iref_error->raise_message
          exporting
            type = 'I'.
        leave list-processing.
        exit.
      endif.
    I hope someone can help me.
    Thanks.
    EDIT:
    Today I tested the ABAP Report SAPRDEMOOFFICEINTEGRATION in our webgui
    it returns me this error:
         In dem Programm "C_OI_CONTAINER_CONTROL_CREATORCP" wurde durch eine                           
          RAISE-Anweisung die Exception                                                                
         (Ausnahmebedingung) "JAVABEANNOTSUPPORTED" ausgelöst.                                         
         Da die Exception nicht durch ein in der Aufrufhierarchie
    Auslösestelle des Laufzeitfehlers                                                                  
         Programm                                 C_OI_CONTAINER_CONTROL_CREATORCP                      
         Include                                  OFFICEINTEGRATIONDCCIMP                               
         Zeile                                    70                                                    
         Modultyp                                 (METHOD)                                              
         Modulname                                I_OI_CONTAINER_CONTROL~INIT_CONTROL
    Edited by: Sascha Baumann on Jul 15, 2009 9:18 AM
    Edited by: Sascha Baumann on Jul 16, 2009 8:04 AM

    Hi Sascha,
    I have the same issue as yours.
    Did you find a way to open your excel file in the WebGui?
    Regards,

  • Desktop Office Integration in ITS

    I'm in a situation where I need to use "Desktop Office Integration" (DOI) in the ITS. But DOI is only supported in WinGUI. So I'm looking for a workaround.
    My case is that I'm using the LinkServer in DMS, so that some metadata is linked direct from the Word document and updated whenever the user opens the document.
    The LinkServer is available as a part of WinGUI and the ITS doesn't contain a workaround.
    Am I the only one banging ny head on the wall in this issue?

    Hello,
    The final solution was to create an RFC server application in .NET that receives the office document, saves it to disk, opens the document with the relevant Office application through automation. And also updates the fields in the document. Saved the document to disk again and sendt it back to SAP.
    Br,
    Thomas Mouritsen

  • Desktop Office Integration - How to use Weblinks for Images in linkserver?

    Hello experts,
    I want to add an image from the internet (e.g. Link: www.images.de/image.jpeg) to the linkserver in order to paste it in my word document. As I know it should be possible to do so with the link server. I tried it before with business documents "BDS" and it works fine. But in my opinion this place is not the best place to store pictures. So I want to use the pictures, which are currently stored in our portal and are available via weblink.
    So, actually, I have to give the information about the link to the link server method "add_binary_item", but with something like that "http://www......" it doesnt work! Do I have to enter a prefix or something like this???
    I hope someone could help me with that issue.
    THanks and regards,
    marcus

    Hello,
    I did it and it works fine!
    But I had to use the BDS Business Document Service with Class cl_bds_document_set.
    So I used the method "get_with_url" to get the url from the document/picture.
    After that I cann add a binary item with the URL and it works fine if my pictures are stored in BDS.
    But that is not what I want to do. I want to store the pictures in my mime repository for example. Are there any other possibilities to do that? Or is Desktop Office Integrations supporting just documents/pictures which are stored in BDS???
    Regards, Marcus
    Edited...........................................................
    In best case I am able to user internet urls for the pictures. So "http://www.xcxy.de/picture.jpeg", but with this URL information it doesn´t work!
    So, my question is if I have to add a prefix or something like this in order to use weblinks.
    Edited by: Marcus Findeisen on Apr 19, 2011 9:16 AM

  • Creating and filling JTables dynamically

    Hello,
    How can I create and display a JTable dynamically in a Java application? In my application, I retrieve rows from a database and therefore I don't know in advance how many rows I need for my JTable (using the tablemodel). I tried to solve the problem in the following way:
    1)start op applicatie with a JTable with 0 rows (screen is grey, only columns are visible)
    2)run query and count number of rows.
    3)create new JTable based on number retrieved in step 2 and tried to put it onto the screen.
    4)run query again and fill table with values retrieved from query
    The bottleneck so far is step 3. I can create a new table but I don't manage to put it onto the screen (i tried already the repaint() method)
    Thanx for you help
    Frits

    Sure, no problem. Assume you've retrieved the following result from the database:First Name     Last Name     Age
    John           Doe           25
    Jane           Doe           27
    Joe            Smith         40
    Mary           Smith         19You create your JTable as like this:Vector headings = new Vector();
    Vector rows = new Vector();
    Vector cells = null;
    JTable table = null;
    for(int x=0; x< resultSize; x++){//resultSize is the size of your result
      cells = new Vector(); //Cells together will represent a row
      cells.add(yourResult.getTheFirstColumnForRowX()); //Pseudo-code
      cells.add(yourResult.getTheSecondColumnForRowX()); //Pseudo-code
      cells.add(yourResult.getTheThirdColumnForRowX()); //Pseudo-code
      //Now place those cells into the rows vector
      rows.add(cells);
    //Create the JTable
    table = new JTable(rows, headings);This code is not tested and is meant to give you an idea of how the concept can be applied. Hope it helps.

  • How to create and add table type to a DDIC Structure in sap 3.1H

    How to create and add table type to a DDIC Structure in sap 3.1H

    How to create and add table type to a DDIC Structure in sap 3.1H

  • I recently updated to the OSX 10.8.3 Operating Sistem.  I am writing a book and now cannot open any word document I've created.  Could not find a newer version of the Microsoft Word Processing Program.  Is Pages the next thing? Can I recover my documents?

    I recently updated to the OSX 10.8.3 Operating Sistem.  I am writing a book and now cannot open any word document I've created with the old system.  Could not find a newer version of the Microsoft Word Processing Program.  Is Pages the next thing? Can I recover my documents?  How?

    I'm in the same boat: new to OS X and Mac, and in the middle of a book. I switched because I heard about the the ease of using Mac, but so far, for me, it's been a nightmare. I bought 2011 Office Mac and hate everything about it, the most recent being the inability to open or cut or paste any of my original word files. I understand that this could have easily been done with earlier versions, but not Mountain Lion (which I learned is what OSX is.) Since I work with language, I am amazed at the assumptions of the Apple community. It helps to use common language and explain even the basics.  
    So all the helpful hints to use the latest version of Office Mac are to no avail. Now what?

  • I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix

    I created a 5x7 postcard document in Word with text boxes and graphics.  When I converted it to PDF, some of the items were missing, even though they were in the boundaries of the page and looked fine on the Word document.  What happened, and how do I fix it?  I'm trying to upload the PDF version to Vistaprint.  Thanks.

    Reader doesn’t create pdf files. You can use Acrobat (ask in that forum) to create pdfs. You can subscribe to the Adobe PDF Pack which has a create pdf functionality (please ask in that forum), or you can use a third party utility such as ghostscript, cutepdf, or Microsoft’s own PDF creation capability. For third party pdf creation you will need to ask in a forum dedicated to that software as fellow users of Reader are unlikely to have the knowledge to help.

  • Excel table in a word document coming up black during pdf convert

    I am converting word 2003 documents to pdf using adobe professional 7.0 and an excel table inside the word document is coming out as completely filled in black after the convert.
    any help would be much appreciated.
    Thanks tim

    If you are having problems creating a PDF, there are two steps you should do FIRST
    Go to the appropriate vendor web site and apply all updates to the program you are using (several recent messages have concerned problems with MS Word conversion, with the response that different versions of Word have different BUGS that must be fixed by a download from Microsoft - and MS Office products are not the only ones which may, from time to time, need to be updated to work properly)
    Go to the Acrobat update page and apply the updates for your version of Acrobat
    IN NUMBER ORDER (updates are not cumulative so, using version 8 as an example, you must apply 8.1.0 before the 8.1.1 update)
    http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows
    Acrobat 7.0 has several updates to apply

  • How do I copy a color from Kuler and paste it to a word document?

    How do I copy a color theme from Kuler and paste it to a word document?

    Unless there is something unusual about the table, it should copy in by selecting in Pages, selecting Copy, moving to Keynote, tapping, seelcing paste.
    If the table structure is copying in, but you can't see the text (is that what is happening?), you might try selecting ghe table and changing the text color using the formatting tool.

  • Why can't I copy and paste portions of the Word document that I just converted from a PDF file?

    Why can't I copy and paste portions of the Word document that I just had converted from a PDF file on your site?

    Hi,
    I am moving your posting to Adobe CreatePDF forum.
    Hisami

  • Why can't I translate between Swedish and Polish in the same Word document. This means I want to switch between two keyboards.

    Why can't I get a Polish keyboard easily accessible from within my Word program? I have to choose it in Finder and then I can't switch back and forth between English/Swedish and Polish in the same Word document. Surely there must be a simple way of doing this by means of keyboard commands while I write, or do I have to go back to my old PC for that?
    Ulf Magnusson

    (1) You are talking about switching keyboard layouts, not about translating from Swedish to Polish or viceversa.
    (2) The keyboard layout choice is not a function of the application (MS Word) in either Mac OS X or Windows; it is a system choice.
    (3) Read
    <http://docs.info.apple.com/article.html?path=Mac/10.7/en/mchlp2214.html>
    specifically "Input source list" and "Input source shortcuts".
    In short, you choose the three keylayouts you wish to use for English, Polish, and Swedish, respectively, and then you set the shortcuts you prefer to use to switch between them.
    And it's all there, in the Help files, on your very own computer…

Maybe you are looking for

  • SSMS 2014 File Extensions

    Why can't I associate file extensions within SSMS 2014?  I want .TAB, .PRC, .UDF, etc. to open as a .SQL file would, i.e. connected to a server and with appropriate syntax colour coding. Adding an extension in Tools\Options\Text Editor\File Extension

  • I have a HP Officejet Pro 8500 wireless. Does it support "air print'?

    I just purchased an iPad2.  I have setup a wireless network in my home. My laptop, printer and Blu-ray are attached to this. The iPad2 said the wireless printer must be "air print" enabled.  I can not find anywhere there is a mention of "air print" o

  • Tutorial Resources for Adobe Bridge PS CS3 for Windows?

    Can anyone provide links to some really good Adobe Bridge CS3 tutorials? I'd liked to find resources other than those found from within Bridge it's self. So far, my Google-ing hasn't produced the desired results. Thanks.

  • Can any one help how can I include junit in upload image interface?

    I did upload image interface with jsp and servlet. I just need to know can I include this with junit? If so how? can anyone help?

  • Http tool not connecting with the PI

    Hii,, I have done http to soap scenario... but when i want to test from http tool (HTML file which i got from sdn) its not connecting with PI i given the right information in Header portion and copied my payload to html tool. when i press send button