<?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: Transfer from Internal Table to csv file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448336#M212500</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;you can specify the format of file as CSV in the SEPARATOR parameter of GUI_DOWNLOAD or you can use the FM .SAP_CONVERT_TO_CSV_FORMAT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jun 2006 15:34:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-15T15:34:50Z</dc:date>
    <item>
      <title>Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448331#M212495</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;Is it possible to downlad internal table to external file of type CSV ?? &lt;/P&gt;&lt;P&gt;(The FM GUI_DOWNLOAD doesn't enable that)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:23:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448331#M212495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448332#M212496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The function GUI_DOWNLOAD has a field called SEPARATOR. Specify , there - then you should have a CSV file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:26:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448332#M212496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448333#M212497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, use this instead: SAP_CONVERT_TO_CSV_FORMAT&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448333#M212497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448334#M212498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use GUI_DOWNLOAD to do this, but you need to pass a flat table with the data separated by commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: it001 type table of t001 with header line.
data: iout type table of string .
data: xout type string.
field-symbols: &amp;lt;fs&amp;gt;.

select * into table it001 from t001.

loop at it001.

  clear xout.
  do.
    assign component sy-index of structure it001 to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    if sy-index = 1.
      xout = &amp;lt;fs&amp;gt;.
    else.
      concatenate xout &amp;lt;fs&amp;gt; into xout separated by ','.
    endif.
  enddo.

  append xout to iout.

endloop.

call function 'GUI_DOWNLOAD'
     exporting
          filename = 'C:test.csv'
     tables
          data_tab = iout.

&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>Thu, 15 Jun 2006 15:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448334#M212498</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-15T15:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448335#M212499</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 the code...&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.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME = 'C:TEMPtest.txt'
  TABLES
    DATA_TAB = ITAB1
  EXCEPTIONS
    OTHERS   = 1.&lt;/CODE&gt;&lt;/PRE&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>Thu, 15 Jun 2006 15:33:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448335#M212499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448336#M212500</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;you can specify the format of file as CSV in the SEPARATOR parameter of GUI_DOWNLOAD or you can use the FM .SAP_CONVERT_TO_CSV_FORMAT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:34:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448336#M212500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448337#M212501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  It is possible with GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

CONSTANTS :
         lc_file_type  TYPE char10 VALUE 'DAT'.

  DATA : lit_head_det  TYPE TABLE OF ty_head_det,
         wa_head_det   LIKE LINE  OF lit_head_det,

         lit_head_sum  TYPE TABLE OF ty_head_sum,
         wa_head_sum   LIKE LINE  OF lit_head_sum,

         lv_file_name  TYPE string.

  CLEAR: lit_head_det[],
         wa_head_det,
         lv_file_name.




*----------------Column Header for Detail Report----------------------*
*  wa_head_det-create_date    = text-023 .
  wa_head_det-partner        = text-046 .
*  wa_head_det-bpext          = text-047 .
  wa_head_det-leg_sp_id      = text-047 .
  wa_head_det-nomship_ref    = text-024 .
  wa_head_det-offer          = text-025 .
  wa_head_det-conf_ref_no    = text-026 .
  wa_head_det-con_eff_date   = text-027 .
  wa_head_det-activity_date  = text-028 .
  wa_head_det-rej_text       = text-029 .
  wa_head_det-trf_date       = text-030 .
  wa_head_det-mprn           = text-031 .
  wa_head_det-mprn_status    = text-032 .
  wa_head_det-mam_app        = text-036 .
  wa_head_det-open_read      = text-010 .
  APPEND wa_head_det TO lit_head_det.

*----------------Column Header for Summary Report----------------------*
  wa_head_sum-date           = text-023 .
  wa_head_sum-count          = text-051 .
  APPEND wa_head_sum TO lit_head_sum.


*----------------Progress Indicator For the User----------------------*
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      percentage = 100
      text       = text-053
    EXCEPTIONS
      OTHERS     = 1.

*   SY-SUBRC Check Not Required


*----------------Download Detail Report to Excel----------------------*
*---Assign Detail File Path
  lv_file_name = xv_det_fp.

*---Load Header Data of Detail Report
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = lv_file_name
      filetype                = lc_file_type
      write_field_separator   = lc_true
      codepage                = '4103'
    TABLES
      data_tab                = lit_head_det
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6
      header_not_allowed      = 7
      separator_not_allowed   = 8
      filesize_not_allowed    = 9
      header_too_long         = 10
      dp_error_create         = 11
      dp_error_send           = 12
      dp_error_write          = 13
      unknown_dp_error        = 14
      access_denied           = 15
      dp_out_of_memory        = 16
      disk_full               = 17
      dp_timeout              = 18
      file_not_found          = 19
      dataprovider_exception  = 20
      control_flush_error     = 21
      OTHERS                  = 22.
  IF sy-subrc = 0.

*----Load Detail Report Data to Excel File
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = lv_file_name
        filetype                = lc_file_type
        append                  = lc_true
        write_field_separator   = lc_true
        codepage                = '4103'
      TABLES
        data_tab                = lit_det_report
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.

  ENDIF.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   202 : Error Occurred while writing data to the file.
    MESSAGE e202(zusm_gen) .
    EXIT.
  ELSE.
    WRITE :/ text-042 , lv_file_name.
  ENDIF.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448337#M212501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448338#M212502</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;Yes it is possible to do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For downloading file on application server :&lt;/P&gt;&lt;P&gt;Open dataset ...&lt;/P&gt;&lt;P&gt;loop at itab into wa_tab.&lt;/P&gt;&lt;P&gt;concatenate wa_tab-field1&lt;/P&gt;&lt;P&gt;            wa_tab-field2&lt;/P&gt;&lt;P&gt;            separated by ','&lt;/P&gt;&lt;P&gt;            into l_record.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;transfer l_record into l_file.&lt;/P&gt;&lt;P&gt;close dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For downloading on presentation server,&lt;/P&gt;&lt;P&gt;Pass separator in the parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 15:40:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448338#M212502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T15:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer from Internal Table to csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448339#M212503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is pity that possible to assign 10 points for one post only &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2006 16:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-from-internal-table-to-csv-file/m-p/1448339#M212503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-15T16:15:29Z</dc:date>
    </item>
  </channel>
</rss>

