<?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 file from presentation server and splitting fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955769#M393386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read this link. The problem is the '#" you see is not character , they are tabs, and what is the character for tab to split. &lt;/P&gt;&lt;P&gt;In the examples they declare c_tab as X. But split can take only character/ string type. And also the number of  tabs vary depending field has value or not. sometime if there is no value in one field there can be 2 tabs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Feb 2007 22:55:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-22T22:55:43Z</dc:date>
    <item>
      <title>Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955763#M393380</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 am trying to upload a file (tab delimited file) which has header data as well as item data. I need to separate header data and line item data and individual fields.&lt;/P&gt;&lt;P&gt;I am using GUI_UPLOAD to load the file into an internal table with one element with 250 character . Now I need to separate the fields depending on tab. How can I do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the file is of the format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1      field2           field3        -&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;&amp;gt;header heading.&lt;/P&gt;&lt;P&gt;1213       xxxx           2121 -&lt;/P&gt;&lt;HR originaltext="-------------------" /&gt;&lt;P&gt;&amp;gt; values&lt;/P&gt;&lt;P&gt;field4      field5          field6            -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;&amp;gt;item heading&lt;/P&gt;&lt;P&gt;XXXXXXXX   2132143        YYYYYYYYY       -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; item values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 21:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955763#M393380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T21:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955764#M393381</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;pass HAS_FIELD_SEPARATOR = 'X' for tab delimited file..&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;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 21:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955764#M393381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T21:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955765#M393382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Hemanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What U can do ii upload the data from file to an itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Read table itab index 2.

Move the header to first line of the final tab.

COnstant con_tab type X value 09.

SPLIT itab at contab into final tab field

Append final tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 21:55:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955765#M393382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T21:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955766#M393383</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;Thanks for the all the help. I feel I was not clear with my question.&lt;/P&gt;&lt;P&gt;The internal table looks like this in debug mode. Now I need to split individual fields into respective fields. some times few fields have no values. Then there will be more tabs to split.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    1	Document Date#Document Type#Company Code#Posting Date#Currency#Reference#D&lt;/P&gt;&lt;P&gt;    2	1/18/2007#RA#1100#1/22/2007#USD#mtrtest 987654#GL Upload1#######          &lt;/P&gt;&lt;P&gt;    3	Posting Key#G/L Account#Amount in Doc. Cur.#Cost Center#Text #Tax Code?#Co&lt;/P&gt;&lt;P&gt;    4	40#73110#123.45#110200#Test Line 1#I0#######1080#                         &lt;/P&gt;&lt;P&gt;    5	50#73210#-23.01##Test Line 2#I0##100000######                             &lt;/P&gt;&lt;P&gt;    6	50#75310#-51.45##Test Line 3#I0###10001E#####                             &lt;/P&gt;&lt;P&gt;    7	50#73210#-48.99##Test Line 4#I0####300002#0###&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 22:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955766#M393383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T22:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955767#M393384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;If the itab doesnt have any values fro the field then if u split at # then blank value goes to the filed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better create a structure similar to the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will easirer for u to split.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 22:48:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955767#M393384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T22:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955768#M393385</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;Check the link, reply from Raghvendra, its a working example..&lt;/P&gt;&lt;P&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="1071804"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpul replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking in debugging mode, so the space in tab delimited file will always appear as # only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Amit Khare&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 22:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955768#M393385</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2007-02-22T22:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955769#M393386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read this link. The problem is the '#" you see is not character , they are tabs, and what is the character for tab to split. &lt;/P&gt;&lt;P&gt;In the examples they declare c_tab as X. But split can take only character/ string type. And also the number of  tabs vary depending field has value or not. sometime if there is no value in one field there can be 2 tabs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 22:55:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955769#M393386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T22:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955770#M393387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your structure only contains only one field of character type then SPILT your record with &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; and move respective fields to structure.Generally tab will be displayed as # in debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;constants:c_tab type c value cl_abap_char_utilities=&amp;gt;horizontal_tab.
loop at itab.

split itab-field at CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB 
into f1 f2 f3.

itab_new-f1 = f1
itab_new-f2 = f2
itab_new-f3 = f3

append itab_new.
clear itab_new.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;If the defined record contains fields of structure then use function module 'GUI_UPLOAD'.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = IT_DATA
EXCEPTIONS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Naresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 23:32:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955770#M393387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T23:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955771#M393388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution worked and you deserve full points. Can you please explain me the logic of this. I am not so good at ABAP OO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 15:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955771#M393388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T15:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Upload file from presentation server and splitting fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955772#M393389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hemath,&lt;/P&gt;&lt;P&gt;   Would you mind if  I explain..:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants:c_tab type c value cl_abap_char_utilities=&amp;gt;horizontal_tab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the above decalration is for recognizing the TAB character .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;NOw onwards c_tab is nothing but the tab character(it will hold a hex value of the TAB character).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For each record in the uploaded table, &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;split itab-field at CL_ABAP_CHAR_UTILITIES=&amp;gt;HORIZONTAL_TAB &lt;/P&gt;&lt;P&gt;into f1 f2 f3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Split the continuos string with the TAB separator at the TAB into different variables f1,f2,f3 etc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab_new-f1 = f1&lt;/P&gt;&lt;P&gt;itab_new-f2 = f2&lt;/P&gt;&lt;P&gt;itab_new-f3 = f3&lt;/P&gt;&lt;P&gt;( Move the field values into another table) &lt;/P&gt;&lt;P&gt;append itab_new.&lt;/P&gt;&lt;P&gt;clear itab_new.&lt;/P&gt;&lt;P&gt; (Append them).&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2007 15:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-file-from-presentation-server-and-splitting-fields/m-p/1955772#M393389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-23T15:43:15Z</dc:date>
    </item>
  </channel>
</rss>

