<?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: Create an Excel File Using OPEN DATASET Command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139266#M114026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For ur requirement, one way,what we can do is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) open the file using open dataset.&lt;/P&gt;&lt;P&gt;b) read and load it into internal table.&lt;/P&gt;&lt;P&gt;c) save this internal table to front-end&lt;/P&gt;&lt;P&gt;using GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;D) then again read the file&lt;/P&gt;&lt;P&gt;using GUI_UPLOAD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Feb 2006 07:05:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-08T07:05:37Z</dc:date>
    <item>
      <title>Create an Excel File Using OPEN DATASET Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139263#M114023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey, everyone.&lt;/P&gt;&lt;P&gt;How can I create an Excel file by using OPEN DATASET command ??&lt;/P&gt;&lt;P&gt;The file is created but the columns are no seperated like thay should.&lt;/P&gt;&lt;P&gt;I need to seperate the internal table's fields with a comma - How can I do it ?&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt; OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt; IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;   LOOP AT gt_vend_info into gwa_vend_info.&lt;/P&gt;&lt;P&gt;     TRANSFER gwa_vend_info TO filename1.&lt;/P&gt;&lt;P&gt;     IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;       EXIT.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 06:59:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139263#M114023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T06:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create an Excel File Using OPEN DATASET Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139264#M114024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Beki,&lt;/P&gt;&lt;P&gt;    Hope the gt_vend_info is having the data with comma separated and is a single string which you'll be writing into the file. In that case your internal table goes in as a line with fields separated with commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    For writing it as a excel file (.csv file) try passing the filename1 as "try.csv" and check whether its working properly by creating a excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;JK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 07:03:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139264#M114024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T07:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create an Excel File Using OPEN DATASET Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139265#M114025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Beki,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZTESTAA.

TYPE-POOLS:TRUXS.
DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAP-VBELN,
      POSNR LIKE VBAP-POSNR,
      END OF ITAB.
DATA:
ITAB1 TYPE TRUXS_T_TEXT_DATA.
SELECT  VBELN
        POSNR
     UP TO 10 ROWS
     FROM VBAP
     INTO TABLE ITAB.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
  EXPORTING
    I_FIELD_SEPERATOR    = ';'
  TABLES
    I_TAB_SAP_DATA       = ITAB
  CHANGING
    I_TAB_CONVERTED_DATA = ITAB1
  EXCEPTIONS
    CONVERSION_FAILED    = 1
    OTHERS               = 2.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO         WITH SY-MSGV1
SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
LOOP AT gt_vend_info into gwa_vend_info.
TRANSFER gwa_vend_info TO filename1.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code give CSV format file, all fields will be separated by ';'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 07:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139265#M114025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T07:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create an Excel File Using OPEN DATASET Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139266#M114026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For ur requirement, one way,what we can do is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) open the file using open dataset.&lt;/P&gt;&lt;P&gt;b) read and load it into internal table.&lt;/P&gt;&lt;P&gt;c) save this internal table to front-end&lt;/P&gt;&lt;P&gt;using GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;D) then again read the file&lt;/P&gt;&lt;P&gt;using GUI_UPLOAD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 07:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139266#M114026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T07:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create an Excel File Using OPEN DATASET Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139267#M114027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;make these changes to the above code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;OPEN DATASET filename1 FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC = 0.
LOOP AT &amp;lt;b&amp;gt;itab1&amp;lt;/b&amp;gt; into &amp;lt;b&amp;gt;wa_itab&amp;lt;/b&amp;gt;.
TRANSFER &amp;lt;b&amp;gt;wa_itab&amp;lt;/b&amp;gt; TO filename1.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
EXIT.ENDIF.
ENDLOOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just modify my above code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 07:08:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-an-excel-file-using-open-dataset-command/m-p/1139267#M114027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T07:08:36Z</dc:date>
    </item>
  </channel>
</rss>

