<?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 converting CSV file into internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638405#M876269</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 have to convert a large CSV file (&amp;gt;20.000 entries) into an internal table. I used FM GUI_UPLOAD to get a raw data table then convert this table using FM &lt;STRONG&gt;TEXT_CONVERT_CSV_TO_SAP&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;But this does not seem to work properly: after 16.000 or so, the FM seems stuck as if in an endless loop.&lt;/P&gt;&lt;P&gt;Note that if I split the CSV file in several parts, the conversion runs successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any memory limit with this FM ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Apr 2008 09:52:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-10T09:52:11Z</dc:date>
    <item>
      <title>Error converting CSV file into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638405#M876269</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 have to convert a large CSV file (&amp;gt;20.000 entries) into an internal table. I used FM GUI_UPLOAD to get a raw data table then convert this table using FM &lt;STRONG&gt;TEXT_CONVERT_CSV_TO_SAP&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;But this does not seem to work properly: after 16.000 or so, the FM seems stuck as if in an endless loop.&lt;/P&gt;&lt;P&gt;Note that if I split the CSV file in several parts, the conversion runs successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any memory limit with this FM ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2008 09:52:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638405#M876269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-10T09:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting CSV file into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638406#M876270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
Florian Labrouche,

Instead of using two function modules, you can use  'TEXT_CONVERT_XLS_TO_SAP' function module once by specifying file name in that function module itself. It does not take much time.

Check the sample program.
&lt;PRE&gt;&lt;CODE&gt;report  zvenkat-upload-xl  no standard page heading.
"----------------------------------------------------------------------
"Declarations.
"----------------------------------------------------------------------
"types
types:
      begin of t_bank_det,
        pernr(8)  type c,
        bnksa(4)  type c,
        zlsch(1)  type c,
        bkplz(10) type c,
        bkort(25) type c,
        bankn(18) type c,
      end of t_bank_det.
"work areas
data:
      w_bank_det type t_bank_det.
"internal tables
data:
      i_bank_det type table of t_bank_det.
"---------------------------------------------------------------------
" selection-screen
"----------------------------------------------------------------------
selection-screen begin of block b1 with frame title text_001.
parameters p_file type localfile.
selection-screen end of block b1.
*---------------------------------------------------------------------
"At selection-screen on value-request for p_file.
*---------------------------------------------------------------------
at selection-screen on value-request for p_file.
  perform f4_help.
*---------------------------------------------------------------------
  "Start-of-selection.
*---------------------------------------------------------------------
start-of-selection.
  perform upload_data.
*---------------------------------------------------------------------
  "End-of-selection.
*---------------------------------------------------------------------
end-of-selection.
  perform display_data.
*&amp;amp;---------------------------------------------------------------------*
  "Form  f4_help
*&amp;amp;---------------------------------------------------------------------*
form f4_help .
  data:
        l_file_name like  ibipparms-path  .

  call function 'F4_FILENAME'
    exporting
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 'P_FILE'
    importing
      file_name     = l_file_name.

  p_file = l_file_name.

endform.                                                    " f4_help
*---------------------------------------------------------------------*
"Form  upload_data
*---------------------------------------------------------------------*
form upload_data .
  type-pools:truxs.
  data:li_tab_raw_data type  truxs_t_text_data.
  data:l_filename      like  rlgrap-filename.

  l_filename = p_file.
  call function 'TEXT_CONVERT_XLS_TO_SAP'
    exporting
      i_tab_raw_data       = li_tab_raw_data
      i_filename           = l_filename
    tables
      i_tab_converted_data = i_bank_det
    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.

endform.                    " upload_data
*---------------------------------------------------------------------*
" Form  display_data
*---------------------------------------------------------------------*
form display_data .
  data: char100 type char100.
  loop at i_bank_det into w_bank_det .
    if sy-tabix = 1.
      write w_bank_det.
      write / '------------------------------------------------------------'.
    else.
      write / w_bank_det.
    endif.
  endloop.

endform.                    " display_data&lt;/CODE&gt;&lt;/PRE&gt;     

Regards,
Venkat.O
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 02:57:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638406#M876270</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2008-04-11T02:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting CSV file into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638407#M876271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5137830"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4825318"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5194264"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4825318"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it is useful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 03:23:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638407#M876271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T03:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error converting CSV file into internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638408#M876272</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;But the file i have to transfer is in CSV format, and can't be changed to XLS.&lt;/P&gt;&lt;P&gt;Anyhow, i managed to solve my problem: instead of using frontend interface, i transfer first the file to the application server and convert it simply with &lt;STRONG&gt;OPEN DATASET... READ DATASET... CLOSE DATASET&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 08:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-converting-csv-file-into-internal-table/m-p/3638408#M876272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T08:31:31Z</dc:date>
    </item>
  </channel>
</rss>

