<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: OLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136029#M989080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following link for detailed information on OLE methods and other related information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is part of SAP Desktop Office Integration which has other methods to integrate with other desktop applications and error handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 10:31:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-23T10:31:36Z</dc:date>
    <item>
      <title>OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136022#M989073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;i want write program that will work with excel file using ole methods.&lt;/P&gt;&lt;P&gt;can anybody give me links to available books, articles, materials about&lt;/P&gt;&lt;P&gt;OLE methods, properties?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 09:57:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136022#M989073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T09:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136023#M989074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report ZMULTICOLOR_TEST no standard page heading.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this report demonstrates how to send some ABAP data to an&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEL sheet using OLE automation.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;include ole2incl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;handles for OLE objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: h_excel type ole2_object,        " Excel object&lt;/P&gt;&lt;P&gt;      h_mapl type ole2_object,         " list of workbooks&lt;/P&gt;&lt;P&gt;      h_map type ole2_object,          " workbook&lt;/P&gt;&lt;P&gt;      h_zl type ole2_object,           " cell&lt;/P&gt;&lt;P&gt;      h_f type ole2_object,            " font&lt;/P&gt;&lt;P&gt;      h_c type ole2_object.            " color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: FILENAME LIKE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: spfli.&lt;/P&gt;&lt;P&gt;data  h type i.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;table of flights&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: it_spfli like spfli occurs 10 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;   Event START-OF-SELECTION&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;read flights&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select * from spfli into table it_spfli.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  uline (61).&lt;/P&gt;&lt;P&gt;  write: /     sy-vline no-gap,&lt;/P&gt;&lt;P&gt;          (3)  'Flg'(001) color col_heading no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;          (4)  'Nr'(002) color col_heading no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;          (20) 'Von'(003) color col_heading no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;          (20) 'Nach'(004) color col_heading no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;          (8)  'Zeit'(005) color col_heading no-gap, sy-vline no-gap.&lt;/P&gt;&lt;P&gt;  uline /(61).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display flights&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_spfli.&lt;/P&gt;&lt;P&gt;    write: / sy-vline no-gap,&lt;/P&gt;&lt;P&gt;             it_spfli-carrid color col_key no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;             it_spfli-connid color col_normal no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;             it_spfli-cityfrom color col_normal no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;             it_spfli-cityto color col_normal no-gap, sy-vline no-gap,&lt;/P&gt;&lt;P&gt;             it_spfli-deptime color col_normal no-gap, sy-vline no-gap.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  uline /(61).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;tell user what is going on&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'SAPGUI_PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;     exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          PERCENTAGE = 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           text       = text-007&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            others     = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;start Excel&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create object h_excel 'EXCEL.APPLICATION'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; PERFORM ERR_HDL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  set property of h_excel  'Visible' = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'  .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; PERFORM ERR_HDL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;tell user what is going on&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'SAPGUI_PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;     exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          PERCENTAGE = 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           text       = text-008&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            others     = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get list of workbooks, initially empty&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method of h_excel 'Workbooks' = h_mapl.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;add a new workbook&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method of h_mapl 'Add' = h_map.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;tell user what is going on&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'SAPGUI_PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;     exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          PERCENTAGE = 0&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;           text       = text-009&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            others     = 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;output column headings to active Excel sheet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform fill_cell using 1 1 1 200 'Carrier id'(001).&lt;/P&gt;&lt;P&gt;  perform fill_cell using 1 2 1 200 'Connection id'(002).&lt;/P&gt;&lt;P&gt;  perform fill_cell using 1 3 1 200 'City from'(003).&lt;/P&gt;&lt;P&gt;  perform fill_cell using 1 4 1 200 'City to'(004).&lt;/P&gt;&lt;P&gt;  perform fill_cell using 1 5 1 200 'Dep. Time'(005).&lt;/P&gt;&lt;P&gt;  loop at it_spfli.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;copy flights to active EXCEL sheet&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    h = sy-tabix + 1.&lt;/P&gt;&lt;P&gt;    if it_spfli-carrid cs 'AA'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 000255000 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-carrid cs 'AZ'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 168000000 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-carrid cs 'JL'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 168168000 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-carrid cs 'LH'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 111111111 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-carrid cs 'SQ'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 100100100 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 1 0 000145000 it_spfli-carrid.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if it_spfli-connid lt 400.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 2 0 255000255 it_spfli-connid.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-connid lt 800.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 2 0 077099088 it_spfli-connid.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 2 0 246156138 it_spfli-connid.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if it_spfli-cityfrom cp 'S*'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-cityfrom cp 'N*'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if it_spfli-cityto cp 'S*'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 4 0 200200200 it_spfli-cityto.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-cityto cp 'N*'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 4 0 000111222 it_spfli-cityto.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 4 0 130230230 it_spfli-cityto.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if it_spfli-deptime lt '020000'.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 5 0 145145145 it_spfli-deptime.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-deptime lt '120000' .&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 5 0 015215205 it_spfli-deptime.&lt;/P&gt;&lt;P&gt;    elseif it_spfli-deptime lt '180000' .&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 5 0 000215205 it_spfli-deptime.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      perform fill_cell using h 5 0 115115105 it_spfli-deptime.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEL FILENAME&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CONCATENATE SY-REPID '_' SY-DATUM&lt;EM&gt;6(2) '_' SY-DATUM&lt;/EM&gt;4(2) '_'&lt;/P&gt;&lt;P&gt;              SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  free object h_excel.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FORM FILL_CELL                                                *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      sets cell at coordinates i,j to value val boldtype bold       *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form fill_cell using i j bold col val.&lt;/P&gt;&lt;P&gt;  call method of h_excel 'Cells' = h_zl&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      #1 = i&lt;/P&gt;&lt;P&gt;      #2 = j.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;  set property of h_zl 'Value' = val .&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;  get property of h_zl 'Font' = h_f.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;  set property of h_f 'Bold' = bold .&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;  set property of h_f 'Color' = col.&lt;/P&gt;&lt;P&gt;  perform err_hdl.&lt;/P&gt;&lt;P&gt;endform.                    "FILL_CELL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  ERR_HDL&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      outputs OLE error if any                                       *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form err_hdl.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    write: / 'OLE-Automation Error:'(010), sy-subrc.&lt;/P&gt;&lt;P&gt;    stop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " ERR_HDL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 09:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136023#M989074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T09:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136024#M989075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this link ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/db/9987b3c3cf11d194ad00a0c94260a5/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/db/9987b3c3cf11d194ad00a0c94260a5/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sowjanya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136024#M989075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136025#M989076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this threads:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/uploading-multiple-multitab-excel-sheets-or-ranges.htm" target="test_blank"&gt;http://www.sap-img.com/abap/uploading-multiple-multitab-excel-sheets-or-ranges.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/tip/1,289483,sid21_gci775513,00.html#" target="test_blank"&gt;http://searchsap.techtarget.com/tip/1,289483,sid21_gci775513,00.html#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Adil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:03:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136025#M989076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136026#M989077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have worked on OLE earlier and found this links to be useful .&lt;/P&gt;&lt;P&gt;In cae you dont get your reply you can revert back with your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE6/BCFESDE6.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE6/BCFESDE6.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;A href="http://www.sapfans.com/forums/viewtopic.php?f=13&amp;amp;t=309588" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?f=13&amp;amp;t=309588&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nisrin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:05:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136026#M989077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136027#M989078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zdownload_excel_multi .
*
INCLUDE ole2incl.
DATA w_index TYPE i.
DATA:
  application TYPE ole2_object,
  workbook    TYPE ole2_object,
  sheet       TYPE ole2_object,
  cells       TYPE ole2_object,
  sheet1      TYPE ole2_object,
  sheets      TYPE ole2_object.

CONSTANTS:
  row_max TYPE i VALUE 256.

DATA:
  index TYPE i,
  det   TYPE REF TO cl_abap_structdescr,
  wa    LIKE LINE OF det-&amp;gt;components.

DATA:
  BEGIN OF i_finaltab OCCURS 0,
    col1 TYPE i,
    col2 TYPE i,
    col3 TYPE i,
    col4 TYPE i,
  END OF i_finaltab.

DATA :
  count TYPE i,
  v_excel_count(3), " type i value 1,
  sheet_name(15) .

***********************************************************************
*START-OF-SELECTION
***********************************************************************
START-OF-SELECTION.


  DO 15 TIMES.
    count = count + 1.
    i_finaltab-col2 = 5 * count.
    i_finaltab-col3 = 10 * count.
    i_finaltab-col4 = 20 * count.
    MOVE : count TO i_finaltab-col1.
    APPEND i_finaltab.
    CLEAR i_finaltab.
  ENDDO.

  CLEAR count.

  CREATE OBJECT application 'excel.application'.
  SET PROPERTY OF application 'visible' = 1.
  CALL METHOD OF application 'Workbooks' = workbook.
  CALL METHOD OF workbook 'Add'.


*Create first Excel Sheet
  w_index = w_index + 1.
  CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING
    #1 = w_index.
  CALL METHOD OF sheet 'Activate'.
  SET PROPERTY OF sheet 'Name' = 'EXCEL0'.

  count = 1.
  index = row_max * ( count - 1 ) + 1.
  PERFORM header_details.

  LOOP AT i_finaltab.

    count = count + 1.

    IF count LE 6.

      index = row_max * ( count - 1 ) + 1. " 1 - column name

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.

      SET PROPERTY OF cells 'Value' = i_finaltab-col1.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col2.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col3.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col4.

    ELSE.
      v_excel_count = v_excel_count + 1.

      CONCATENATE 'EXCEL' v_excel_count INTO sheet_name.

      CLEAR count.
      count = count + 1.

      w_index = w_index + 1.
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING
        #1 = w_index.
      SET PROPERTY OF sheet 'Name' = sheet_name.
      CALL METHOD OF sheet 'Activate'.

      index = row_max * ( count - 1 ) + 1.

      PERFORM header_details.

      count = count + 1.

      index = row_max * ( count - 1 ) + 1. " 1 - column name
      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col1.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col2.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col3.

      index = index + 1.

      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
        #1 = index.
      SET PROPERTY OF cells 'Value' = i_finaltab-col4.


    ENDIF.
  ENDLOOP.

FORM header_details.

  det ?= cl_abap_typedescr=&amp;gt;describe_by_data( i_finaltab ).

  LOOP AT det-&amp;gt;components INTO wa.
    CALL METHOD OF sheet 'Cells' = cells
      EXPORTING
      #1 = index.
    SET PROPERTY OF cells 'Value' = wa-name.
    index = index + 1.
  ENDLOOP.

ENDFORM. " header_details&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:21:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136027#M989078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136028#M989079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use following code for OLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  YOLE_FORMATING_EXCEL.
* OLE2 include
INCLUDE ole2incl.

* OLE2 objects.
DATA:
 excel       TYPE ole2_object,
 workbook    TYPE ole2_object,
 book        TYPE ole2_object,
 activesheet TYPE ole2_object,
 range       TYPE ole2_object,
 cell        TYPE ole2_object,
 bold        TYPE ole2_object,
 w_temp     TYPE ole2_object,         " OLE Object for Sheet
 w_sheet    TYPE ole2_object,         " OLE Object for Sheet
 interior    TYPE ole2_object.

* Internal table for the flight information.
DATA:
  t_material LIKE STANDARD TABLE
               OF makt
             WITH HEADER LINE
          INITIAL SIZE 0.

* Work Variables declaration.
DATA:
  W_CHAR(2)  TYPE C,                   " Holds cell value
  w_cell1(3) TYPE c,                   " Holds cell value
  w_cell2(3) TYPE c,                   " Holds cell value
  w_row_num  TYPE i VALUE 1,           " Row Number.
  w_col_num  TYPE i VALUE 1.           " Column Number.

START-OF-SELECTION.
* Selecting the flight information from spfli table.
  SELECT *
    FROM makt
    INTO TABLE t_material
      up to 10 rows.

* Creating the excel application object.
  CREATE OBJECT excel 'EXCEL.APPLICATION'.

* Creating work book
  CALL METHOD OF excel 'WORKBOOKS' = workbook.

* Adding a book to the workbook
  CALL METHOD OF workbook 'ADD' = book.

* Merging third(C1), fouth(D1) cells of row one.
  CALL METHOD OF excel 'range' = range
    EXPORTING
      #1 = 'B1'
      #2 = 'D1'.
  CALL METHOD OF range 'merge'.

* Making the book added as the active sheet and setting its property  to
* visible mode
  CALL METHOD OF book 'ACTIVESHEET' = activesheet.
  SET PROPERTY OF excel 'VISIBLE' = 1.

* Writing header informaion to the excel sheet.
  PERFORM fill_heading.
* Displaying the material information in the active sheet.
  PERFORM data_display.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FILL_HEADING                                             *
*&amp;amp;---------------------------------------------------------------------*
*  This subroutine will fill heading in the excel sheet for the data to*
*  to be displayed.                                                    *
*----------------------------------------------------------------------*
* No interface parameters exist.                                       *
*----------------------------------------------------------------------*
FORM fill_heading .
* Set row and column positions for each cell
  DO 2 TIMES.
    CALL METHOD OF excel 'CELLS' = cell
      EXPORTING
        #1 = 1
        #2 = sy-index.
    IF sy-index EQ 1.
* Set properties of cell for material.
      SET PROPERTY OF cell 'VALUE'               = 'MATNR'.
      SET PROPERTY OF cell 'HorizontalAlignment' =  -4108.
      SET PROPERTY OF cell 'ColumnWidth'         = 12.
      GET PROPERTY OF cell 'FONT'                = bold.
      SET PROPERTY OF bold 'BOLD'                = 1 .
      SET PROPERTY OF bold 'size'                = 10.
      GET PROPERTY OF cell 'Interior'            = interior.
      SET PROPERTY OF interior 'Color'           = '55000'.
    ELSE.
* Set properties of cell for material description.
      SET PROPERTY OF cell 'VALUE'               = 'MAKTX'.
      SET PROPERTY OF cell 'HorizontalAlignment' =  -4108.
      SET PROPERTY OF cell 'ColumnWidth'         = 12.
      GET PROPERTY OF cell 'FONT'                = bold.
      SET PROPERTY OF bold 'BOLD'                = 1 .
      SET PROPERTY OF bold 'size'                = 10.
      GET PROPERTY OF cell 'Interior'            = interior.
      SET PROPERTY OF interior 'Color'           = '55000'.
    ENDIF.
  ENDDO.
ENDFORM.                               " FILL_HEADING
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  DATA_DISPLAY                                             *
*&amp;amp;---------------------------------------------------------------------*
*  This subroutine will display flight information in the excel sheet. *
*----------------------------------------------------------------------*
* No interface parameters exist.                                       *
*----------------------------------------------------------------------*
FORM data_display .
  LOOP AT t_material.
    MOVE 1 TO  w_col_num.
    ADD  1 TO  w_row_num.
* For selecting the cell
    CALL METHOD OF excel 'CELLS' = cell NO FLUSH
      EXPORTING
        #1 = w_row_num
        #2 = w_col_num.
    SET PROPERTY OF cell 'NumberFormat' = '@'.
    SET PROPERTY OF cell 'VALUE'               = t_material-matnr.
    SET PROPERTY OF cell 'HorizontalAlignment' =  -4108.
    SET PROPERTY OF cell 'ColumnWidth'         = 12.
.


* For displaying the matnr information in the cell.
    ADD 1 TO w_col_num.
    MOVE w_row_num TO w_char.
    CONCATENATE 'B' w_char  INTO w_cell1.
    CONCATENATE 'D' w_char  INTO w_cell2.

* Merging third(b1), fouth(c1) cells of row one.
    CALL METHOD OF excel 'range' = range NO FLUSH
      EXPORTING
        #1 = w_cell1
        #2 = w_cell2.
    CALL METHOD OF range 'merge'.

* For bordering the material description
    CALL METHOD OF RANGE 'BORDERAROUND'
      EXPORTING
       #1 = 1
       #2 = 2
       #3 = -4105
       #4 = 35000.

* For putting the data inthe corresponding cell.
    CALL METHOD OF excel 'CELLS' = cell NO FLUSH
      EXPORTING
        #1 = w_row_num
        #2 = w_col_num.
    SET PROPERTY OF cell 'VALUE'               = t_material-maktx.
    SET PROPERTY OF cell 'HorizontalAlignment' =  -4108.
    SET PROPERTY OF cell 'ColumnWidth'         = 12.

  ENDLOOP.

ENDFORM.                    "data_display&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;twinkal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:25:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136028#M989079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: OLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136029#M989080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following link for detailed information on OLE methods and other related information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is part of SAP Desktop Office Integration which has other methods to integrate with other desktop applications and error handling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 10:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ole/m-p/4136029#M989080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T10:31:36Z</dc:date>
    </item>
  </channel>
</rss>

