<?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 Error while opening the EXCEL Sheet from a Report Program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496732#M230591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error saying 'SYLK: File Format is not valid' when my program is trying to open an excel sheet. I am using the function module WS_EXCEL to download it to excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is the code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Excel download&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;types: begin of t_excel,&lt;/P&gt;&lt;P&gt;         c01(20),&lt;/P&gt;&lt;P&gt;         c02(20),&lt;/P&gt;&lt;P&gt;         c03(20),&lt;/P&gt;&lt;P&gt;         c04(20),&lt;/P&gt;&lt;P&gt;         c05(70),&lt;/P&gt;&lt;P&gt;         c06(20),&lt;/P&gt;&lt;P&gt;         c07(20),&lt;/P&gt;&lt;P&gt;         c08(20),&lt;/P&gt;&lt;P&gt;         c09(20),&lt;/P&gt;&lt;P&gt;         c10(20),&lt;/P&gt;&lt;P&gt;       end of t_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: a00_excel type standard table of t_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'C:\' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.&lt;/P&gt;&lt;P&gt;condense z_fname no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; call function 'WS_EXCEL'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;           filename = z_fname&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;           data     = a00_excel&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;           others   = 1.&lt;/P&gt;&lt;P&gt; if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;   message e019(zsd).&lt;/P&gt;&lt;P&gt;  Download to Excel failed.&lt;/P&gt;&lt;P&gt; endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a00_excel contains the data that is to be downloaded into the excel sheet. I used the same code in the other program it is working fine. If you see in the type declaration for C5 its 70 characters, i tried putting it as same as others to 20... still it doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Aug 2006 17:09:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-08T17:09:57Z</dc:date>
    <item>
      <title>Error while opening the EXCEL Sheet from a Report Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496732#M230591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error saying 'SYLK: File Format is not valid' when my program is trying to open an excel sheet. I am using the function module WS_EXCEL to download it to excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is the code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Excel download&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;types: begin of t_excel,&lt;/P&gt;&lt;P&gt;         c01(20),&lt;/P&gt;&lt;P&gt;         c02(20),&lt;/P&gt;&lt;P&gt;         c03(20),&lt;/P&gt;&lt;P&gt;         c04(20),&lt;/P&gt;&lt;P&gt;         c05(70),&lt;/P&gt;&lt;P&gt;         c06(20),&lt;/P&gt;&lt;P&gt;         c07(20),&lt;/P&gt;&lt;P&gt;         c08(20),&lt;/P&gt;&lt;P&gt;         c09(20),&lt;/P&gt;&lt;P&gt;         c10(20),&lt;/P&gt;&lt;P&gt;       end of t_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: a00_excel type standard table of t_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'C:\' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.&lt;/P&gt;&lt;P&gt;condense z_fname no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; call function 'WS_EXCEL'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;           filename = z_fname&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;           data     = a00_excel&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;           others   = 1.&lt;/P&gt;&lt;P&gt; if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;   message e019(zsd).&lt;/P&gt;&lt;P&gt;  Download to Excel failed.&lt;/P&gt;&lt;P&gt; endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a00_excel contains the data that is to be downloaded into the excel sheet. I used the same code in the other program it is working fine. If you see in the type declaration for C5 its 70 characters, i tried putting it as same as others to 20... still it doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 17:09:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496732#M230591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T17:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening the EXCEL Sheet from a Report Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496733#M230592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure man,  your code works ok for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.


types: begin of t_excel,
c01(20),
c02(20),
c03(20),
c04(20),
c05(70),
c06(20),
c07(20),
c08(20),
c09(20),
c10(20),
end of t_excel.

data: a00_excel type standard table of t_excel.
data: x00_excel like line of a00_excel.
data: z_fname type string.

x00_excel-c01 = 'A'.
x00_excel-c02 = 'B'.
x00_excel-c03 = 'C'.
x00_excel-c04 = 'D'.
x00_excel-c05 = 'E'.
x00_excel-c06 = 'F'.
x00_excel-c07 = 'G'.
x00_excel-c08 = 'H'.
x00_excel-c09 = 'I'.
x00_excel-c10 = 'J'.
append x00_excel to a00_excel.

x00_excel-c01 = 'K'.
x00_excel-c02 = 'L'.
x00_excel-c03 = 'M'.
x00_excel-c04 = 'N'.
x00_excel-c05 = 'O'.
x00_excel-c06 = 'P'.
x00_excel-c07 = 'Q'.
x00_excel-c08 = 'R'.
x00_excel-c09 = 'S'.
x00_excel-c10 = 'T'.
append x00_excel to a00_excel.


concatenate 'C:' sy-repid sy-uzeit 'FILE01' '.xls' into z_fname.
condense z_fname no-gaps.

call function 'WS_EXCEL'
     exporting
          filename = z_fname
     tables
          data     = a00_excel
     exceptions
          others   = 1.
if sy-subrc ne 0.
  message e019(zsd).
*  download to excel failed.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 17:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496733#M230592</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-08T17:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening the EXCEL Sheet from a Report Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496734#M230593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the format of sy-uzeit. You may not be able to save it with special characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 17:26:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496734#M230593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T17:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening the EXCEL Sheet from a Report Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496735#M230594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try by adding the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear x00_excel.&lt;/P&gt;&lt;P&gt;x00_excel-c01 = 'IDoc Num'.&lt;/P&gt;&lt;P&gt;x00_excel-c02 = 'IDoc Date'.&lt;/P&gt;&lt;P&gt;x00_excel-c03 = 'Delivery Date'.&lt;/P&gt;&lt;P&gt;x00_excel-c04 = 'P.O. Number'.&lt;/P&gt;&lt;P&gt;x00_excel-c05 = 'EDI Type'.&lt;/P&gt;&lt;P&gt;x00_excel-c06 = 'Sold-To No'.&lt;/P&gt;&lt;P&gt;x00_excel-c07 = 'Sales Org'.&lt;/P&gt;&lt;P&gt;x00_excel-c08 = 'Dist Chnl'.&lt;/P&gt;&lt;P&gt;x00_excel-c09 = 'Division'.&lt;/P&gt;&lt;P&gt;x00_excel-c10 = 'Total Weight'.&lt;/P&gt;&lt;P&gt;append x00_excel to a00_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 20:30:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496735#M230594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-08T20:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening the EXCEL Sheet from a Report Program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496736#M230595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't explain it but changing the 'D' to 'd' in IDoc worked for me.. ie the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear x00_excel.&lt;/P&gt;&lt;P&gt;x00_excel-c01 = 'Idoc Num'.&lt;/P&gt;&lt;P&gt;x00_excel-c02 = 'Idoc Date'.&lt;/P&gt;&lt;P&gt;x00_excel-c03 = 'Delivery Date'.&lt;/P&gt;&lt;P&gt;x00_excel-c04 = 'P.O. Number'.&lt;/P&gt;&lt;P&gt;x00_excel-c05 = 'EDI Type'.&lt;/P&gt;&lt;P&gt;x00_excel-c06 = 'Sold-To No'.&lt;/P&gt;&lt;P&gt;x00_excel-c07 = 'Sales Org'.&lt;/P&gt;&lt;P&gt;x00_excel-c08 = 'Dist Chnl'.&lt;/P&gt;&lt;P&gt;x00_excel-c09 = 'Division'.&lt;/P&gt;&lt;P&gt;x00_excel-c10 = 'Total Weight'.&lt;/P&gt;&lt;P&gt;append x00_excel to a00_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be ID means something to the Excel document..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Aug 2006 20:42:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-the-excel-sheet-from-a-report-program/m-p/1496736#M230595</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-08-08T20:42:10Z</dc:date>
    </item>
  </channel>
</rss>

