<?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 Split command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951521#M65273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Í´m uploading a file with OPEN DATASET fron the app server. I read the contents into a string. I then want to split the contents of each string into my internal table/ work area. For some reason it packs everything into the first field (type string). When I test with other data in the string, everything is fine. The contents of the string is eg. '01#AED#EUR#1001#' . I´m worried that the '#' symbol is for tabulator or something and therefore the SPLIT command does not work correctly. But if its a string it should recognise # as a symbol? &lt;/P&gt;&lt;P&gt;Thanks for any ideas? &lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Aug 2005 18:44:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-22T18:44:04Z</dc:date>
    <item>
      <title>Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951521#M65273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Í´m uploading a file with OPEN DATASET fron the app server. I read the contents into a string. I then want to split the contents of each string into my internal table/ work area. For some reason it packs everything into the first field (type string). When I test with other data in the string, everything is fine. The contents of the string is eg. '01#AED#EUR#1001#' . I´m worried that the '#' symbol is for tabulator or something and therefore the SPLIT command does not work correctly. But if its a string it should recognise # as a symbol? &lt;/P&gt;&lt;P&gt;Thanks for any ideas? &lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2005 18:44:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951521#M65273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-22T18:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951522#M65274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0002 .


parameters: d1 type localfile default '/usr/sap/TST/SYS/Test.txt'.

data: begin of itab occurs 0,
      field1(20) type c,
      field2(20) type c,
      field3(20) type c,
      end of itab.
data: wa type string.

&amp;lt;b&amp;gt;CONSTANTS: con_tab TYPE x VALUE '09'.&amp;lt;/b&amp;gt;

* if you have a newer version, then you can use this instead.
&amp;lt;b&amp;gt;*constants:
*    con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB.&amp;lt;/b&amp;gt;


start-of-selection.

  open dataset d1 for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset d1 into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.

* Here you are splitting at the hex value of "tab" not at
* the # sign.  

      split wa at con_tab into itab-field1 itab-field2 itab-field3.
      append itab.
    enddo.
  endif.
  close dataset d1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked good in my system.&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2005 18:53:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951522#M65274</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-22T18:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951523#M65275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like it is the tabulator. What you can do is declare a variable as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:c_tab type x value '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that you can use your split command as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT v_string at c_tab.&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;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2005 19:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951523#M65275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-22T19:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951524#M65276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;nice one! Its working fine now. I´m using SAP ERP and the 'type x value '09' wasn´t working for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following value definition did the trick!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2005 19:08:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951524#M65276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-22T19:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951525#M65277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please award points accordingly and mark this post as solved.  Thanks.&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, 22 Aug 2005 19:09:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951525#M65277</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-22T19:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Split command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951526#M65278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Rich's answer solved your problem, please reward him with full points and close the post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2005 19:09:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-command/m-p/951526#M65278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-22T19:09:29Z</dc:date>
    </item>
  </channel>
</rss>

