<?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 A TEXT FILE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497437#M230798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1. First u read the file and load it into ur internal table. U can use the FM GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;2. Don't make any change to flat file. U create another structure where it has the needed fields alone.&lt;/P&gt;&lt;P&gt;Once u load the data into the internal table.&lt;/P&gt;&lt;P&gt;Copy the data into ur structure(Which has needed field).&lt;/P&gt;&lt;P&gt;Eg. it_neededfields[] = it_wholefields[].&lt;/P&gt;&lt;P&gt;This will copy the needed fields.&lt;/P&gt;&lt;P&gt;3.Open the file, at the end of the field place the cursor and press delete, if the next fields comes very closer, then it is tab delimiter field else if deletes only one space it is not a tab delimiter file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will help u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Sep 2006 04:49:44 GMT</pubDate>
    <dc:creator>baskaran00</dc:creator>
    <dc:date>2006-09-06T04:49:44Z</dc:date>
    <item>
      <title>UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497433#M230794</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 need to upload a txt file into ztable.I HAVE FEW UNWANTED FIELDS IN MY TEXT FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i WANT TO READ ONLY THE USEFUL DATA INTO INTERNAL TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HOW SHOULD I MOVE THE DATA INTO INTERNAL TABLE WHEN I UPLOAD IT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hOW CAN I KNOW WHETHER ITS A TAB DELIMITED FILE OR NOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tHANKS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 20:35:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497433#M230794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T20:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497434#M230795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi deepthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read all the data into internal table from text file and then get rid of the unwanted data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 20:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497434#M230795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T20:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497435#M230796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest using a comma delimited file for all data upload,  I think that it makes an easier.   You can use GUI_UPLOAD to upload the test file.  Make your internal table flat like....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: itab type table of string with header line.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use GUI_UPLOAD to upload into ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have an internal table with lots of rows with comma delimited data in it.  Lets separate it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declase another internal table with your fields. Now loop at the ITAB and split it apart into your fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab.

  clear itab2.
  split itab at ',' into itab2-fld1 itab2-fld2, itab2-fld3.
append itab2.
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>Tue, 05 Sep 2006 20:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497435#M230796</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-05T20:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497436#M230797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1- store the text file in the excel format&lt;/P&gt;&lt;P&gt;2- delete the unnecessary column from the file in excel sheet&lt;/P&gt;&lt;P&gt;3- save it again into text file by choosing the option taxt(tab delimited).&lt;/P&gt;&lt;P&gt;4-delare the internal table(dont include the fields that you r not going to upload)&lt;/P&gt;&lt;P&gt;5-upload the data from the text file using bdc or lsmw&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 04:29:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497436#M230797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T04:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497437#M230798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1. First u read the file and load it into ur internal table. U can use the FM GUI_UPLOAD.&lt;/P&gt;&lt;P&gt;2. Don't make any change to flat file. U create another structure where it has the needed fields alone.&lt;/P&gt;&lt;P&gt;Once u load the data into the internal table.&lt;/P&gt;&lt;P&gt;Copy the data into ur structure(Which has needed field).&lt;/P&gt;&lt;P&gt;Eg. it_neededfields[] = it_wholefields[].&lt;/P&gt;&lt;P&gt;This will copy the needed fields.&lt;/P&gt;&lt;P&gt;3.Open the file, at the end of the field place the cursor and press delete, if the next fields comes very closer, then it is tab delimiter field else if deletes only one space it is not a tab delimiter file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will help u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 04:49:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497437#M230798</guid>
      <dc:creator>baskaran00</dc:creator>
      <dc:date>2006-09-06T04:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497438#M230799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi deepthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. These are the steps, which we can follow :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   a) create two internal tables.&lt;/P&gt;&lt;P&gt;      1) for upload - with all fields available in text file   eg. ITAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      2) for z table - exactly like z table.&lt;/P&gt;&lt;P&gt;          eg PTAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   (make sure the field names are same)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    b) then using GUI_UPLOAD,&lt;/P&gt;&lt;P&gt;      upload in ITAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   c) Then use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     LOOP AT ITAB.&lt;/P&gt;&lt;P&gt;     CLEAR PTAB.&lt;/P&gt;&lt;P&gt;     MOVE-CORRESPONDING ITAB TO PTAB.&lt;/P&gt;&lt;P&gt;     MODIFY ZDBTAB FROM PTAB.&lt;/P&gt;&lt;P&gt;     ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   (Modify will automatically take care of &lt;/P&gt;&lt;P&gt;   insert / update&lt;/P&gt;&lt;P&gt;   based upon the primary key combination&lt;/P&gt;&lt;P&gt;   found / not found in db table,&lt;/P&gt;&lt;P&gt;   w.r.t to values in internal table work area.&lt;/P&gt;&lt;P&gt;  )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. hOW CAN I KNOW WHETHER ITS A TAB DELIMITED FILE OR NOT&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  U will have to open the file in notepad,&lt;/P&gt;&lt;P&gt;  and look for yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 05:32:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497438#M230799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T05:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: UPLOADING A TEXT FILE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497439#M230800</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;&amp;lt;b&amp;gt;I WANT TO READ ONLY THE USEFUL DATA INTO INTERNAL TABLE.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Here u have two options&lt;/P&gt;&lt;P&gt;a. delete the unwanted data directly from the text file.&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;b. read all data from text file to internal table using gui_upload function &lt;/P&gt;&lt;P&gt;then,&lt;/P&gt;&lt;P&gt;delete the unwanted data from the internal table itself&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
loop at itab.
if itab-f1 = 'xxxx'.
delete itab.
modify itab.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;move the required data to another internal table&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
loop at itab.
if itab-f1 &amp;lt;&amp;gt; 'xxxx'.
move-corresponding itab to itab2
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;b&amp;gt;HOW SHOULD I MOVE THE DATA INTO INTERNAL TABLE WHEN I UPLOAD IT.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;declare the an internal table of same structue as the internal table that u have used for uploading text file&lt;/P&gt;&lt;P&gt;then, use &lt;/P&gt;&lt;P&gt;itab2[] = itab[]. or &lt;/P&gt;&lt;P&gt;move itab[] to itab2[].&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;HOW CAN I KNOW WHETHER ITS A TAB DELIMITED FILE OR NOT.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;goto end of the text file then use the tab button. Then if the cursor is positioning at the begin of field, we can say its is tab delimited. or the fields length may specified in characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Sep 2006 06:45:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/uploading-a-text-file/m-p/1497439#M230800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-06T06:45:43Z</dc:date>
    </item>
  </channel>
</rss>

