<?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: CSV FORMAT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501535#M232215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is more than one way, but here is one solution for comma delimited files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

types: begin of ttab,
       rec(1000) type c,
       end of ttab.

types: begin of tdat,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of tdat.

data: itab type table of ttab with header line.
data: idat type table of tdat with header line.

data: file_str type string.

parameters: p_file type localfile.

at selection-screen on value-request for p_file.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file.

start-of-selection.

  file_str = p_file.

  call function 'GUI_UPLOAD'
       exporting
            filename                = file_str
       tables
            data_tab                = itab
       exceptions
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            others                  = 17.


  loop at itab.
    clear idat.
    split itab-rec at ',' into idat-fld1
                               idat-fld2
                               idat-fld3.
    append idat.

  endloop.


  loop at idat.
    write:/ idat-fld1, idat-fld2, idat-fld3.
  endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Wed, 26 Jul 2006 17:46:09 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-07-26T17:46:09Z</dc:date>
    <item>
      <title>CSV FORMAT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501534#M232214</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 WANT TO UPLOAD THE CSV(FILE) TO THE INTERNAL TABLE IS THERE ANY FM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 17:43:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501534#M232214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T17:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: CSV FORMAT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501535#M232215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is more than one way, but here is one solution for comma delimited files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

types: begin of ttab,
       rec(1000) type c,
       end of ttab.

types: begin of tdat,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of tdat.

data: itab type table of ttab with header line.
data: idat type table of tdat with header line.

data: file_str type string.

parameters: p_file type localfile.

at selection-screen on value-request for p_file.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file.

start-of-selection.

  file_str = p_file.

  call function 'GUI_UPLOAD'
       exporting
            filename                = file_str
       tables
            data_tab                = itab
       exceptions
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            others                  = 17.


  loop at itab.
    clear idat.
    split itab-rec at ',' into idat-fld1
                               idat-fld2
                               idat-fld3.
    append idat.

  endloop.


  loop at idat.
    write:/ idat-fld1, idat-fld2, idat-fld3.
  endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&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>Wed, 26 Jul 2006 17:46:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501535#M232215</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-26T17:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: CSV FORMAT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501536#M232216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the &amp;lt;b&amp;gt;'GUI_UPLOAD'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = 'C:\tt.csv'&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = itab&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR = 2&lt;/P&gt;&lt;P&gt;NO_BATCH = 3&lt;/P&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 4&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 5&lt;/P&gt;&lt;P&gt;NO_AUTHORITY = 6&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 7&lt;/P&gt;&lt;P&gt;BAD_DATA_FORMAT = 8&lt;/P&gt;&lt;P&gt;HEADER_NOT_ALLOWED = 9&lt;/P&gt;&lt;P&gt;SEPARATOR_NOT_ALLOWED = 10&lt;/P&gt;&lt;P&gt;HEADER_TOO_LONG = 11&lt;/P&gt;&lt;P&gt;UNKNOWN_DP_ERROR = 12&lt;/P&gt;&lt;P&gt;ACCESS_DENIED = 13&lt;/P&gt;&lt;P&gt;DP_OUT_OF_MEMORY = 14&lt;/P&gt;&lt;P&gt;DISK_FULL = 15&lt;/P&gt;&lt;P&gt;DP_TIMEOUT = 16&lt;/P&gt;&lt;P&gt;OTHERS = 17.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jul 2006 17:47:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/csv-format/m-p/1501536#M232216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-26T17:47:38Z</dc:date>
    </item>
  </channel>
</rss>

