Download to Excel with Header but one field data is repeating

Hi All,
I'm downloading to Excel with Header. But One field is repeating and another is not. This is happening only when I use   'CONCATENATE ' . With Out this key usage data download to excel is correct. But   CONCATENATE is required as constant need to add before the one field.
My coding is as below.
DATA: BEGIN OF IT_FINAL OCCURS 0,
      P1(10) TYPE C,
      SI(19) type c, 
        END OF IT_FINAL.
DATA : BEGIN OF IT_HEADER OCCURS 0,
TITLE(100) TYPE C,
END OF IT_HEADER,WA_HEADER LIKE IT_HEADER.
loop at it_final.
  CONCATENATE '894412' it_final-SI INTO IT_FINAL.
modify it_final.
endloop.
CLEAR:WA_HEADER.
  WA_HEADER-TITLE = 'Mat No'.
  APPEND WA_HEADER TO IT_HEADER.
  CLEAR:WA_HEADER.
  WA_HEADER-TITLE = 'Serial'.
  APPEND WA_HEADER TO IT_HEADER.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
    EXPORTING
      FILE_NAME  = P_FILE " path offile where u need to download
    TABLES
      DATA_TAB   = IT_FINAL
      FIELDNAMES = IT_HEADER.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
    EXPORTING
      FILE_NAME  = P_FILE " path offile where u need to download
    TABLES
      DATA_TAB   = IT_FINAL
      FIELDNAMES = IT_HEADER.
Excel OUT PUT:
Mat No            Serial
11Z52321     8944126000
11Z52394     8944126000
11Z52395     8944126000
Thank You,
Pranitha

hi,
it would have been better if u hve opt for creating workarea for ur internal table.
Try to use "clear it_final" after
CONCATENATE '894412' it_final-SI INTO IT_FINAL.
n also change the modify statement :
modify it_final transporting SI .
hope this will surely help you
Regards,
Punit
Edited by: punit raval on Aug 26, 2011 2:55 PM

Similar Messages

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • Generate a PDF from Excel with a Digital Signature Field?

    Hello,
    I have an excel workbook that is filled out weekly- I then have to generate a PDF with a digital signature field for a manager to sign (vouching for the data).  I currently have to manually generate the PDF and then manually add a digital signature field.  Is there any way to generate the PDF from excel with a digital signature field that can then be signed?
    Thanks for any help
    -Nathan

    Moved to Acrobat forum.

  • I have several iCloud shared photo streams . They all download fine into my iPhone, but one doesn't download into my MacBook. Any suggestions?

    I have several iCloud shared photo streams . They all download fine into my iPhone, but one doesn't download into my MacBook. Any suggestions?

    Tried that too over the weekend,I unchecked the Photos option in iCloud preferences in System, let iPhoto do it's thing, then restarted the Mac, and turned iCloud Photos back on again... it looked promising the first hour... but then stopped downloading 20 or so albums. I have over 80 shared albums created over the years.
    Also, the albums it did download, sometimes they're not even complete nor in any particular order.
    I did exactly what you did. It took two days, but slowly all shared streams came back.
    If the photo streams do not reappear, try if removing the content of this folder will help: It contains the photos downloaded from the shared streams. Perhaps one photo is corrupted.
    ~/Library/Application Support/iLifeAssetManagement/assets/sub-shared/
    Quit iPhoto
    Move the folder above from your User Library to the Trash.
    Restart your Mac.

  • Download internal table to excel with header

    Hi All,
    I have a requirement to download internal table contents to excel with field headings. I tried searching in forums before posting but didn't got much help.
    I have used GUI_DOWNLOAD, WS_DOWNLOAD and EXCEL_OLE_STANDARD_DAT.
    But unable to download the header in excel..along with data...
    EXCEL_OLE_STANDARD_DAT is getting field header in excel but not downloading automatically , need to save manually which is not the requirement.
    The data is huge with around 151 columns....I got 2 internal tables.
    One for the data and the other with field names.
    Many Thanks,
    Ravi K

    Hi Ravi,
    You need to have 2 different internal tables for achieving the needful. One internal table would be having your data and another would store your table field names i.e., declare a structure of length 100 characters,
    TYPES : BEGIN OF GTY_FIELDNAMES,
                    TITLE(100),
                  END   OF GTY_FIELDNAMES.
    DATA: GIT_FIELDNAMES TYPE STANDARD TABLE OF GTY_FIELDNAMES,
                GWA_FIELDNAMES TYPE GTY_FIELDNAMES.
    DATA : GD_FILENAME TYPE STRING,
                GD_PATH     TYPE STRING,
                GD_FULLPATH TYPE STRING,
                GD_RESULT   TYPE I.
    Now have a subroutine where by you append your headings into the internal table i.e.,GIT_FIELDNAMES
       CLEAR GWA_FIELDNAMES.
       GWA_FIELDNAMES-TITLE = 'Material Number'.
       APPEND GWA_FIELDNAMES TO GIT_FIELDNAMES.
       CLEAR GWA_FIELDNAMES.
       GWA_FIELDNAMES-TITLE = 'Material Description'.
       APPEND GWA_FIELDNAMES TO GIT_FIELDNAMES.
    Once you are done with it you can call up the save dialog
    * Display save dialog window
       CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
         EXPORTING
           WINDOW_TITLE           = 'Save File As...'
           DEFAULT_EXTENSION  = 'XLS'
           DEFAULT_FILE_NAME  = 'SalesPlan'
           INITIAL_DIRECTORY      = 'C:\'
         CHANGING
           FILENAME                      = GD_FILENAME
           PATH                               = GD_PATH
           FULLPATH                      = GD_FULLPATH
           USER_ACTION               = GD_RESULT.
    * Check user did not cancel request
       CHECK GD_RESULT EQ '0'.
       CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
           FILENAME              = GD_FULLPATH
           FILETYPE                = 'ASC'
    *     APPEND                = 'X'
           WRITE_FIELD_SEPARATOR = 'X'
    *     CONFIRM_OVERWRITE     = 'X'
         TABLES
           DATA_TAB                 = GIT_FINAL                  " Internal table having data
           FIELDNAMES            = GIT_FIELDNAMES     " Internal table having headings
         EXCEPTIONS
           FILE_OPEN_ERROR       = 1                         "#EC ARGCHECKED
           FILE_WRITE_ERROR      = 2
           OTHERS                           = 3.
    Hope this gets sorted your problem.
    Thanks & Regards,
    Varun Kumar Sahu

  • How to download output into Excel with Header?

    Dear Friends,
        I want to download a my list output into excel format with <b>Column heading</b>. How will I do this?
        Another question is i want name of database table in Which SAP stores <b>DDIC object name and its property</b>, so that i can write Select * from ' ' where .... For example i have table ZABC with three fields so i need In which table it stores ZABC as table and a table in which it stores Its field name.

    Hi,
    Look at the sample code for Download into Excel.
    data: begin of excel_sum_it occurs 0,
          bukrs(80),
          belnr(80),
          gjahr(80),
          blart(80),
          budat like bkpf-budat,
          monat(80),
          cpudt like bkpf-cpudt,
          cputm like bkpf-cputm,
          usnam(80),
          tcode(80),
          xblnr(80),
          waers(80),
          dwrbtr(25),
          cwrbtr(25),
          end of excel_sum_it.
    data: begin of titles_it occurs 10,
          title(80),
    end of titles_it.
    at user-command.
      case sy-ucomm.
        when 'SUMMARY'.
          perform summary_download.
        when 'DETAIL'.
          perform detail_download.
        when others.
      endcase.
    ******Create one PF-STATUS for one push button for download.
    Before this FM you need to move your date to Execl_sum_it Internal table.
    For example here I used this table for down load.
    *&      Form  summary_download
          text
    -->  p1        text
    <--  p2        text
    form summary_download.
      data: fname like rlgrap-filename value 'Summary_Details.xls'.
      perform fill_titles.
      check not excel_sum_it[] is initial.
      call function 'DOWNLOAD'
           exporting
                filename                = fname
                filetype                = 'DAT'
           tables
                data_tab                = excel_sum_it
                fieldnames              = titles_it
           exceptions
                invalid_filesize        = 1
                invalid_table_width     = 2
                invalid_type            = 3
                no_batch                = 4
                unknown_error           = 5
                gui_refuse_filetransfer = 6
                customer_error          = 7
                others                  = 8.
      if sy-subrc ne 0.
        message e000 with text-e07.
      endif.
    endform.                    " summary_download
    *&      Form  fill_titles
          text
    -->  p1        text
    <--  p2        text
    form fill_titles.
      refresh titles_it.
      concatenate text-h06 text-h16 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h07 text-h17 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h08 text-h18 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h07 text-h19 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h09 text-h20 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h08 text-h21 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h11 text-h22 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h11 text-h23 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h12 text-h24  into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h13 text-h25 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h07 text-h26 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h13 text-h28  into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h14 text-h27 into titles_it-title
                                          separated by space.
      append titles_it.
      concatenate text-h15 text-h27 into titles_it-title
                                          separated by space.
      append titles_it.
    endform.                    " fill_titles
    ***Here in the FILL_TITLES you give you own HEADER .
    Thanks.
    If this helps you reward with points.

  • ALV  download to EXCEL  with column headings etc.

    Getting data from a grid to EXCEL can be done in "List" mode vis system==>save etc but it's not particularly user friendly and in any case if you are displaying a nice ALV why should the user have to switch into LIST mode anyway.
    Anyway here's a decent way to do it and it gives great formatted column headings etc etc.
    1) in the ON_TOOLBAR method add this code
    method ON_TOOLBAR.
    type-pools icon.
    CLEAR ls_toolbar.
    MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EXCEL' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_xxl TO ls_toolbar-icon.
        MOVE 'Excel' TO ls_toolbar-quickinfo.
        MOVE  'EXCEL' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    2) In the ON_USER_COMMAND method add the following
    (if you have a class defined with SE24 you don't need the commented code).
    method ON_USER_COMMAND.
           FOR EVENT before_user_command OF cl_gui_alv_grid
           IMPORTING
             e_ucomm
             sender.
    CASE e_ucomm.
         .......   other toolbar funcs if you have any
          WHEN 'EXCEL'.
            CALL METHOD me->download_to_excel.
        ENDCASE.
    endmethod.
    3) code this method to download to EXCEL
    method DOWNLOAD_TO_EXCEL.
    FIELD-SYMBOLS:
           <fs0> TYPE STANDARD TABLE,
           <fs1> TYPE STANDARD TABLE.
        ASSIGN g_outtab1->* TO <fs0>.
        ASSIGN g_fldcat1->* TO <fs1>.
           CALL FUNCTION  'LVC_TRANSFER_TO_KKBLO'
          EXPORTING
            it_fieldcat_lvc   = <fs1>
        is_layout_lvc     = m_cl_variant->ms_layout
             is_tech_complete  = ' '
          IMPORTING
            es_layout_kkblo   = ls_layout
            et_fieldcat_kkblo = lt_fieldcat.
        LOOP AT lt_fieldcat INTO lt_fieldcat_wa.
          CLEAR lt_fieldcat_wa-tech_complete.
          IF lt_fieldcat_wa-tabname IS INITIAL.
            lt_fieldcat_wa-tabname = '1'.
            MODIFY lt_fieldcat FROM lt_fieldcat_wa.
          ENDIF.
          l_tabname = lt_fieldcat_wa-tabname.
        ENDLOOP.
        CALL FUNCTION 'ALV_XXL_CALL'
             EXPORTING
                  i_tabname           = l_tabname
                  is_layout           = ls_layout
                  it_fieldcat         = lt_fieldcat
                  i_title             = sy-title
             TABLES
                  it_outtab           = <fs0>
             EXCEPTIONS
                  fatal_error         = 1
                  no_display_possible = 2
                  OTHERS              = 3.
        IF  sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    endmethod.
    You get nice column headings etc and decently formatted EXCEL spreadsheet.
    For Office 2007 I think you need to apply a SAP note but it certainly works with OFFICE 2003 which is what we are still using.
    Cheers
    jimbo

    Getting data from a grid to EXCEL can be done in "List" mode vis system==>save etc but it's not particularly user friendly and in any case if you are displaying a nice ALV why should the user have to switch into LIST mode anyway.
    Anyway here's a decent way to do it and it gives great formatted column headings etc etc.
    1) in the ON_TOOLBAR method add this code
    method ON_TOOLBAR.
    type-pools icon.
    CLEAR ls_toolbar.
    MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EXCEL' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_xxl TO ls_toolbar-icon.
        MOVE 'Excel' TO ls_toolbar-quickinfo.
        MOVE  'EXCEL' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    2) In the ON_USER_COMMAND method add the following
    (if you have a class defined with SE24 you don't need the commented code).
    method ON_USER_COMMAND.
           FOR EVENT before_user_command OF cl_gui_alv_grid
           IMPORTING
             e_ucomm
             sender.
    CASE e_ucomm.
         .......   other toolbar funcs if you have any
          WHEN 'EXCEL'.
            CALL METHOD me->download_to_excel.
        ENDCASE.
    endmethod.
    3) code this method to download to EXCEL
    method DOWNLOAD_TO_EXCEL.
    FIELD-SYMBOLS:
           <fs0> TYPE STANDARD TABLE,
           <fs1> TYPE STANDARD TABLE.
        ASSIGN g_outtab1->* TO <fs0>.
        ASSIGN g_fldcat1->* TO <fs1>.
           CALL FUNCTION  'LVC_TRANSFER_TO_KKBLO'
          EXPORTING
            it_fieldcat_lvc   = <fs1>
        is_layout_lvc     = m_cl_variant->ms_layout
             is_tech_complete  = ' '
          IMPORTING
            es_layout_kkblo   = ls_layout
            et_fieldcat_kkblo = lt_fieldcat.
        LOOP AT lt_fieldcat INTO lt_fieldcat_wa.
          CLEAR lt_fieldcat_wa-tech_complete.
          IF lt_fieldcat_wa-tabname IS INITIAL.
            lt_fieldcat_wa-tabname = '1'.
            MODIFY lt_fieldcat FROM lt_fieldcat_wa.
          ENDIF.
          l_tabname = lt_fieldcat_wa-tabname.
        ENDLOOP.
        CALL FUNCTION 'ALV_XXL_CALL'
             EXPORTING
                  i_tabname           = l_tabname
                  is_layout           = ls_layout
                  it_fieldcat         = lt_fieldcat
                  i_title             = sy-title
             TABLES
                  it_outtab           = <fs0>
             EXCEPTIONS
                  fatal_error         = 1
                  no_display_possible = 2
                  OTHERS              = 3.
        IF  sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    endmethod.
    You get nice column headings etc and decently formatted EXCEL spreadsheet.
    For Office 2007 I think you need to apply a SAP note but it certainly works with OFFICE 2003 which is what we are still using.
    Cheers
    jimbo

  • ALV output download to excel with top of page

    Hi,
    i want to download ALV grid output to excel sheet including the top of page. i am using the icon in application tool bar. but only data's are download to excel sheet. i cannot download the top of page. with out write coding in program can we download it. if yes pls explain.
    thanks.

    I'm sorry but I can't find FM with DOWNLOAD_EXCEL_*.
    I want to know more detail thing.
    plz. give answer to me anytime.
    I'm waiting..
    Edited by: Kwang Seop Kim on Sep 26, 2008 6:57 AM

  • Customize download to excel with disclaimer

    I need to customize download link in dashboard so that results are downloaded to an Excel sheet but with client' s disclaimer message at the end. Client do not want the disclaimer to be shown on the dashboard. So basically we need to alter the download to Excel link at the system level, so that whenever it is clicked, the report gets downloaded to an excel with the disclaimer message at the end.
    I did some work and found that when we click on Download To Excel option, a function gets called from file \OracleBI\web\msgdb \viewscontrolmessages.xml, there we have:
    Download(&#39;@{command}&amp;Format=mht&am p;amp;Extension=.xls&#39;)
    I think someway we need to alter this download function so that it appends a disclaimer message to Excel after every download.
    Or let me know if you think any other way!
    We are using OBIEE 10g .
    Rahul

    This seems now "re-inventing the wheel" sort of requirement. I was looking into possibility of using GO URL to get the report in csv and then writing a java script to append the disclaimer text in the downloaded file . But am stuck on the front, how to store the file without any manual effort. Because when we use Go URL a save as pop-up throws, rather I want when user clicks on our customized Download link, it should download the data and store in a file and then append it with a disclaimer text and then throw a save as pop-up.
    Also has anyone any idea how to use the any OBIEE java functions in a java script written in text view ( with html enabled ) ?
    Let me know if anyone has any thoughts on how to do that!

  • Generating excel with more than one tab

    Hi,
    I would like to ask if anyone of you know how to generate excel file from Oracle Reports with more than one tab? Is it possible? If yes, can you provide me some references on how to do it. Thanks in advance.

    Hi,
    Do this:
    1. Create an Excel file, put some dummy data in 2 or more worksheets. Save as HTM. This will create one main HTM file, and some sub-files under a folder. One HTM sub-file will be created per worksheet. In addition, one XML sub-file (called filelist.xml) and some other sub-files will be created. (you have already done this)
    2. Open one of the HTM sub-files in reports builder, and follow the steps shown in the Excel Demo on OTN to insert data in this file at appropriate place, and save as JSP.
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/excel/index.html
    3. You can repeat this step for all worksheets. So finally you will get one JSP file per worksheet.
    5. Now open the main file in reports builder, and add the Excel contentType element at the top
         <%@ page contentType="application/vnd.ms-excel; charset=windows-1252" %>
    6. In this file, search for the following tag
         <x:WorksheetSource HRef="./filename_files/sheet001.htm"/>
    Note that instead of filename_files you will have your own file name
    Change this tag as following:
         <x:WorksheetSource HRef="./filename_files/sheet001.jsp?userid=scott/tiger@myDb"/>
    Note that in userid, you must provide your own DB connect string
    7. Additionally, change ALL references to sheet001.htm in this file to sheet001.jsp
    Do steps 6 and 7 for sheet002.htm, sheet003.htm, and so on (if needed).
    8. Open filelist.xml (you will find this file inside the folder that contains sub-files). Here, too, change all references to JSP instead of HTM
    9. Now place the main JSP file as well as the folder containing all sub-files inside your J2EE deployment folder. Run the main JSP file. This will run the associated JSP files (the worksheets).
    This will do the trick.
    If you are worried about placing the USERID information inside your JSP code, then you can use CGICMD.DAT file, and place the userid there.
    Navneet.

  • HT201272 I recently downloaded a Cold Chisel Album but one of the songs is incomplete and although the song time is 5.51 minutes the song cuts off at 3.20 minutes, what can I do to get the whole song?

    I have just downloaded a Cold Chisel album and one of the song cuts off after 3.20 minutes even though the song is 5.51 minutes long, it just suddenly cuts off, what can I do to get the whole track downloaded?

    Depending upon what country that you are in have you tried deleting and redownloading it via the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes ? If you aren't in a country where you can re-download music or if it re-downloads in the state then try the 'report a problem' link from your purchase history : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that song and use the 'Report a Problem' link.

  • I downloaded an album from Itunes but one of the songs will only play first 4 minutes. It is the last song on the album. All other songs will play.

    I downloaded an album from i Tunes but one of the songs will only play first 4 minutes of 26 minutes and then stop. It is the last song on the album. All other songs will play. The Album is U.F.O. 2 One Hour of Space Rock.

    Jim, wanted to let you know it worked.  I deleted the entire album since it was an album only (26 minutes long) song, then I went to the home icon of iTunes store, clicked on purchased and saw previous purchases and bam, I downloaded the album again and it now works!!!  Thanks..
    Angelo

  • Download to Excel with Images

    Hello
    The download to excel and PDF documents now includes images.  I have inlcuded images in my web templates to execute commands eg: Download to Excel, Bookmake etc.
    See below:
    img onclick="executeJS_EXPORT_XSLT120();" alt="Download to Excel" src="bwmimerep:///sap/bw/Mime/BEx/Icons/S_X_XLS.gif" border="0"
    These images are simply for command execution and look out of place and serve no purpose in the excel or PDF files.
    My Question:
    Is it possible to exclude these images in the docnload to excel and PDF?
    Thanks in advance.
    Ian
    Message was edited by:
            Ian Carbonel

    Thanks For your reply Prakash.
    This works well after some preliminary testing.
    Thanks
    Ian

  • Sorting issue on - around 20 records based on one field Data Manager

    Hello Experts,
    We are facing issue sorting some records which belong to one contract.
    if we sort by one field ie item no, it is not sorting based on this field. This issue only one set of contract only.
    For other set of data, sorting is working fine.
    Any hint will be appreciated.
    Thanks in advance

    HI saptest,
    I have not heard of such a issue,please provide detailed description of the same to give a better idea.
    Thanks,
    Ravi

  • Download to excel with multiple lines in header

    Hi experts,
    Is there any Funtion module available to download an internal table contents into Local directory of PC with multiple lines in header.
    i.e.  let us say i hv internal table of 5 entries with 3 columns...
    i need to download this 5 entries into an excel file with some texts above the table contents...
    For eg : in the below format...
    Sample line 1
    sample line 2
    sample line 3
    colheader1     colheader2     colheader3
    item1                              
    item2
    item3
    item4
    item5
    Please help.
    Edited by: Lakshmiraj on Jul 15, 2010 3:26 AM

    There is another option of using OLE automation Please check the link below
    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-OLEAutomationusing+MS-Excel
    OR
    chek for the example program in Tcode DWDM ( OLE example )
    OR
    Use FM KCD_EXCEL_OLE_TO_INT_CONVERT ( Fm Uses the same OLE automation)
    Hope it helps
    Anup

Maybe you are looking for