<?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: uploading file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887935#M1479580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types:begin of ty_line,&lt;/P&gt;&lt;P&gt;line type char255, ( give the size as required)&lt;/P&gt;&lt;P&gt;end of ty_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:i_line type table of ty_line.&lt;/P&gt;&lt;P&gt;data:wa_line type ty_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using GUI_UPLOAD upload the file to internal table i_line.&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_line into wa_line.&lt;/P&gt;&lt;P&gt;split wa_line at ',' into wa_itab-field1 wa_itab-field2 wa_itab-field3.&lt;/P&gt;&lt;P&gt;append wa_itab to i_tab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i_tab will hold the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 May 2010 18:44:02 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-05-06T18:44:02Z</dc:date>
    <item>
      <title>uploading file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887933#M1479578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    i have to upload data through bdc... i am doing it using gui_upload...... the file is a text file....&lt;/P&gt;&lt;P&gt;the fields are seperated by comma......... so it is not uploading to the internal table......but when it is given with tabs it is getting uploaded......i have tried using field seperator parameter as ',' .... but it is still not working....pls help me out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance,&lt;/P&gt;&lt;P&gt;syed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 14:25:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887933#M1479578</guid>
      <dc:creator>syed_ibrahim5</dc:creator>
      <dc:date>2010-05-06T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: uploading file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887934#M1479579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SYED_ibbu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dont use field seperator parameter- try command split &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split each line of the file into a string table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uploaded line: &lt;/P&gt;&lt;P&gt;1,2,3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string table: &lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loop at the string table and assign each line to a work area &lt;/P&gt;&lt;P&gt;which is of the same line type like the records in your upload file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;REA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramy EL-ARNAOUTY on May 6, 2010 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 14:48:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887934#M1479579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T14:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: uploading file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887935#M1479580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types:begin of ty_line,&lt;/P&gt;&lt;P&gt;line type char255, ( give the size as required)&lt;/P&gt;&lt;P&gt;end of ty_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:i_line type table of ty_line.&lt;/P&gt;&lt;P&gt;data:wa_line type ty_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using GUI_UPLOAD upload the file to internal table i_line.&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_line into wa_line.&lt;/P&gt;&lt;P&gt;split wa_line at ',' into wa_itab-field1 wa_itab-field2 wa_itab-field3.&lt;/P&gt;&lt;P&gt;append wa_itab to i_tab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i_tab will hold the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 18:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887935#M1479580</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-05-06T18:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: uploading file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887936#M1479581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your solution becoms unclear, if you habe a lot more than 3 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_tab,
        col1 TYPE string,
        col2 TYPE string,
        col3 TYPE string,
       END OF ty_tab.

DATA data_tab TYPE TABLE OF string.
DATA itab     TYPE TABLE OF string.

DATA lt_import TYPE TABLE OF ty_tab.
DATA ls_import TYPE ty_tab.

FIELD-SYMBOLS &amp;lt;data&amp;gt; TYPE string.
FIELD-SYMBOLS &amp;lt;wa&amp;gt;   TYPE string.
FIELD-SYMBOLS &amp;lt;comp&amp;gt; TYPE ANY.

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename = 'C:\Temp\upl.txt'
    filetype = 'ASC'
  TABLES
    data_tab = data_tab.

LOOP AT data_tab
  ASSIGNING &amp;lt;data&amp;gt;.

  SPLIT &amp;lt;data&amp;gt; AT ',' INTO TABLE itab.

  LOOP AT itab
     ASSIGNING &amp;lt;wa&amp;gt;.

    ASSIGN COMPONENT sy-tabix OF STRUCTURE ls_import
      TO &amp;lt;comp&amp;gt;.

    &amp;lt;comp&amp;gt; = &amp;lt;wa&amp;gt;.

  ENDLOOP.

  APPEND ls_import TO lt_import.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_import stores the uploaded records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;REA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramy EL-ARNAOUTY on May 7, 2010 10:19 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 May 2010 08:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-file/m-p/6887936#M1479581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-07T08:18:56Z</dc:date>
    </item>
  </channel>
</rss>

