<?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: upload csv file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505575#M566363</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example program.&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>Mon, 16 Jul 2007 12:56:02 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-07-16T12:56:02Z</dc:date>
    <item>
      <title>upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505573#M566361</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 need to upload a csv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz suggest an appropriate fm or class for the same&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;Navjot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:50:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505573#M566361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505574#M566362</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 use GUI_UPLOAD or KCD_EXCEL_OLE_TO_INT_CONVERT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505574#M566362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T12:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505575#M566363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example program.&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>Mon, 16 Jul 2007 12:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505575#M566363</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-16T12:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505576#M566364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use FM  &amp;lt;b&amp;gt;TEXT_CONVERT_TEX_TO_SAP&amp;lt;/b&amp;gt; and pass separator comma as import parameter....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:57:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505576#M566364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T12:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505577#M566365</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;first upload the csv file into internal table by using GUI_UPLOAD of internal table of one variable of type char(255) or greater.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split itab1 at ',' into itab-fld1 itab-fld2 itab-fld3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now ur internal table contains all the field names and values..&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505577#M566365</guid>
      <dc:creator>Simha_</dc:creator>
      <dc:date>2007-07-16T12:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505578#M566366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;use the FM-&lt;/P&gt;&lt;P&gt;ws_upload or gui_upload. to know more about the FM's u can refer the site &lt;A href="https://community.sap.com/www.se37.com" target="test_blank"&gt;www.se37.com&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*&lt;STRONG&gt;reward points if helpful&lt;/STRONG&gt;*&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 13:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505578#M566366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T13:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: upload csv file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505579#M566367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use... Fm &amp;lt;b&amp;gt;KCD_CSV_FILE_TO_INTERN_CONVERT&amp;lt;/b&amp;gt; in the following way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: KCDE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:  itab1 type KCDE_INTERN.


CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
  EXPORTING
    i_filename            = 'U:tempsheet1_20070519_054301.csv'
    i_separator           = ','
  tables
    e_intern              = itab1
 EXCEPTIONS
   UPLOAD_CSV            = 1
   UPLOAD_FILETYPE       = 2
   OTHERS                = 3
          .
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.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;itab1 contains all the rows and columns of CSV file...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 13:09:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file/m-p/2505579#M566367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T13:09:19Z</dc:date>
    </item>
  </channel>
</rss>

