<?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: Split a string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351411#M1036254</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this .........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND FIRST OCCURRENCE of ''' in section offset off of string.&lt;/P&gt;&lt;P&gt;    " Search for the forst occurence of ' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if off &amp;gt; 72 . 	" if first occurrence is after 72  &lt;/P&gt;&lt;P&gt;off = 72 .	" set the offset to 72&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append string(off) to internal_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string = string + off .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps ....... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Sep 2008 04:42:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-02T04:42:58Z</dc:date>
    <item>
      <title>Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351406#M1036249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where there is a string suppose&lt;/P&gt;&lt;P&gt;$self.qty =  ( ( 3.1429 * dpcc_c * dpcc_c ) / 4 ) * hpcc_c if V_PCC = 'V_PCC_CIRC' , $self.qty =  lpcc_r * bpcc_r * hpcc_r * n if v_PCC = 'V_PCC_RECT' , $self.qty = ( lpcc_t * bpcc_t * hpcc_t * n ) + ( h1pcc_t / 2 * ( lpcc_T + l1pcc_t )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this string i want to divide it according to the '  ' marks so that the both starting and ending codes should be in the same line, and the maximum length of the line is 72 char, so need to divide is first on the basis of ' if no quotes found then split at 72 char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need to check both the conditions single quotes and length in one line 72 and append in a table like the output in the table sholuld be like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$self.qty =  ( ( 3.1429 * dpcc_c * dpcc_c ) / 4 ) * hpcc_c if V_PCC =&lt;/P&gt;&lt;P&gt;'V_PCC_CIRC' , $self.qty =  lpcc_r * bpcc_r * hpcc_r * n if v_PCC =&lt;/P&gt;&lt;P&gt; 'V_PCC_RECT' , $self.qty = ( lpcc_t * bpcc_t * hpcc_t * n )+ ( h1pcc_t&lt;/P&gt;&lt;P&gt; / 2 * ( lpcc_T + l1pcc_t ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest some solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mona&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2008 12:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351406#M1036249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-01T12:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351407#M1036250</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;Use SPLIT  Command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: &lt;/P&gt;&lt;P&gt;  w_data(72) type c 'ABAP is easy'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Split w_data at ' ' into w_data1 w_data2 w_data3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2008 13:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351407#M1036250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-01T13:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351408#M1036251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mona,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        You can use the SPLIT command to split the text. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT dobj AT sep INTO &lt;/P&gt;&lt;P&gt;      { {result1 result2 ...} | {TABLE result_tab} } &lt;/P&gt;&lt;P&gt;      [IN {BYTE|CHARACTER} MODE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      You can move the split string into the TABLE result tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Sep 2008 13:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351408#M1036251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-01T13:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351409#M1036252</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 know to use split command but my problem is i want the quotes along with the string after splitting , but split command removes that and also i need to count 72 characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351409#M1036252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351410#M1036253</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 function module: STRING_SPLIT_AT_POSITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351410#M1036253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351411#M1036254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this .........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND FIRST OCCURRENCE of ''' in section offset off of string.&lt;/P&gt;&lt;P&gt;    " Search for the forst occurence of ' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if off &amp;gt; 72 . 	" if first occurrence is after 72  &lt;/P&gt;&lt;P&gt;off = 72 .	" set the offset to 72&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append string(off) to internal_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string = string + off .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps ....... &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:42:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351411#M1036254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351412#M1036255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use &lt;/P&gt;&lt;P&gt;FIND ALL OCCURRENCES OF substring IN string  RESULTS result_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give offset points of the substring in table result. Loop the table and use the offset to split ur string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:44:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351412#M1036255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351413#M1036256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mona &lt;/P&gt;&lt;P&gt;Please let me know the correct string what you want to split &lt;/P&gt;&lt;P&gt;because what you mentioned text is not possible to post as string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your requirement is clear and it can be happen &lt;/P&gt;&lt;P&gt;please give us correct string and if you like describe us why you doing such a thing.&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;Nelson From Sri Lanka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:49:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351413#M1036256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351414#M1036257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way to get this is to use two nested do loops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The outer loop will split the main string at first single quote.&lt;/P&gt;&lt;P&gt;The inner loop will check lenghth of splitted portion and split it further if lenghth is more than 72.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regarding the lost single quote, you can pad it with concatenate after splitting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside the inner loop you can populate a temp internal table. The final internal table can be built using temp internal table at the end of inner do loop. (temp internal table to be refreshed on end of each inner loop)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please provide proper exit points for both do loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 04:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351414#M1036257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T04:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351415#M1036258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Nelson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the string which i need to append and its taking as a sting no poblem in that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 05:03:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351415#M1036258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T05:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split a string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351416#M1036259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;I know to use split command but my problem is i want the quotes along with the string after splitting , but split command removes that and also i need to count 72 characters.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You said After Split the string quotes are remove.can you not concatenate again only quotes  after split?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 05:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-a-string/m-p/4351416#M1036259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-02T05:17:11Z</dc:date>
    </item>
  </channel>
</rss>

