<?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 Problem with SPLIT with &amp;quot;multiple&amp;quot; separators in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-split-with-quot-multiple-quot-separators/m-p/8904842#M1690167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gurus,&lt;/P&gt;&lt;P&gt;I'm dealing with a simple task on text strings.&lt;/P&gt;&lt;P&gt;Showing it with an example: please consider that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tb_text_unroll is a table with many fields; the relevant fact is that TDLINE field has type "STRING".&lt;/P&gt;&lt;P&gt;itab_tdline is a table containing just a field, TDLINE, which is a CHAR of length 132.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sketch of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;tb_text_unroll &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_text_unroll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;REFRESH &lt;/SPAN&gt;itab_tdline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SPLIT &lt;/SPAN&gt;wa_text_unroll&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;TDLINE &lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;CL_ABAP_CHAR_UTILITIES&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;NEWLINE &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;itab_tdline.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_CHAR_UTILITIES&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;NEWLINE is a separator which is often represented in char strings ad a sharp (#).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is this: if wa_text_unroll&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;TDLINE contains a string which is longer than 132 chars AND the # separator follows that 132nd position, the string isn't correctly splitted into the table.&lt;/P&gt;&lt;P&gt;In example, strings like&lt;/P&gt;&lt;P&gt;"This is a short example of text which will not be correctly splitted as the next separator occours only after the 132nd position, and this leads to the odd behaviour described above.#How can I solve it?#Thanks."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be splitted in the following three rows of itab_tdline:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a short example of text which will not be correctly splitted as the next separator occours only after the 132nd&lt;/P&gt;&lt;P&gt;position, an&lt;/P&gt;&lt;P&gt;How can I solve it?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you can see, a part of the string, from the 133rd position to the separator, is lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to consider multiple separators on the SPLIT clause? Something like "split at NewLine OR if the string exceed 132 chars" ?&lt;/P&gt;&lt;P&gt;Of course there should be many workarounds, like doing a multiple split in sequence, anyway I'd like to know what's the best solution in your opinion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2012 08:38:34 GMT</pubDate>
    <dc:creator>matteo_montalto</dc:creator>
    <dc:date>2012-07-31T08:38:34Z</dc:date>
    <item>
      <title>Problem with SPLIT with "multiple" separators</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-split-with-quot-multiple-quot-separators/m-p/8904842#M1690167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gurus,&lt;/P&gt;&lt;P&gt;I'm dealing with a simple task on text strings.&lt;/P&gt;&lt;P&gt;Showing it with an example: please consider that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tb_text_unroll is a table with many fields; the relevant fact is that TDLINE field has type "STRING".&lt;/P&gt;&lt;P&gt;itab_tdline is a table containing just a field, TDLINE, which is a CHAR of length 132.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sketch of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;tb_text_unroll &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_text_unroll.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;REFRESH &lt;/SPAN&gt;itab_tdline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;SPLIT &lt;/SPAN&gt;wa_text_unroll&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;TDLINE &lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;CL_ABAP_CHAR_UTILITIES&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;NEWLINE &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;itab_tdline.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_CHAR_UTILITIES&lt;SPAN class="L0S70"&gt;=&amp;gt;&lt;/SPAN&gt;NEWLINE is a separator which is often represented in char strings ad a sharp (#).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is this: if wa_text_unroll&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;TDLINE contains a string which is longer than 132 chars AND the # separator follows that 132nd position, the string isn't correctly splitted into the table.&lt;/P&gt;&lt;P&gt;In example, strings like&lt;/P&gt;&lt;P&gt;"This is a short example of text which will not be correctly splitted as the next separator occours only after the 132nd position, and this leads to the odd behaviour described above.#How can I solve it?#Thanks."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be splitted in the following three rows of itab_tdline:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a short example of text which will not be correctly splitted as the next separator occours only after the 132nd&lt;/P&gt;&lt;P&gt;position, an&lt;/P&gt;&lt;P&gt;How can I solve it?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you can see, a part of the string, from the 133rd position to the separator, is lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to consider multiple separators on the SPLIT clause? Something like "split at NewLine OR if the string exceed 132 chars" ?&lt;/P&gt;&lt;P&gt;Of course there should be many workarounds, like doing a multiple split in sequence, anyway I'd like to know what's the best solution in your opinion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 08:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-split-with-quot-multiple-quot-separators/m-p/8904842#M1690167</guid>
      <dc:creator>matteo_montalto</dc:creator>
      <dc:date>2012-07-31T08:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SPLIT with "multiple" separators</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-split-with-quot-multiple-quot-separators/m-p/8904843#M1690168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Google -&amp;gt; convert string to char site:sap.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first link from the top has a solution: &lt;A _jive_internal="true" href="https://answers.sap.com/thread/1489987"&gt;http://scn.sap.com/thread/1489987&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 20:56:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-split-with-quot-multiple-quot-separators/m-p/8904843#M1690168</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2012-08-01T20:56:35Z</dc:date>
    </item>
  </channel>
</rss>

