<?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 string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716222#M629957</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;PRE&gt;&lt;CODE&gt;split mainstring at ';' into string1 string2 string3 string4 string5.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Aug 2007 05:24:16 GMT</pubDate>
    <dc:creator>former_member189059</dc:creator>
    <dc:date>2007-08-20T05:24:16Z</dc:date>
    <item>
      <title>Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716220#M629955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable string which has the value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'string1;string2;string3;string4;string5'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use each individual string from the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. loop through all the strings[n] and process them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are your views on the best way to extract these string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I split them into a table and loop through the table? What would be the syntax for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to ABAP and interested in the best way to carry out processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:16:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716220#M629955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T05:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716221#M629956</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;do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: string(60) TYPE c value 'string1;string2;string3;string4;string5',&lt;/P&gt;&lt;P&gt;      p1(20),&lt;/P&gt;&lt;P&gt;      p2(20),&lt;/P&gt;&lt;P&gt;      p3(20),&lt;/P&gt;&lt;P&gt;      p4(20),&lt;/P&gt;&lt;P&gt;      P5(20),&lt;/P&gt;&lt;P&gt;      del VALUE ';'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE string.&lt;/P&gt;&lt;P&gt;SPLIT string AT del INTO p1 p2 p3 p4 p5.&lt;/P&gt;&lt;P&gt;WRITE / p1.&lt;/P&gt;&lt;P&gt;WRITE / p2.&lt;/P&gt;&lt;P&gt;WRITE / p3.&lt;/P&gt;&lt;P&gt;WRITE / p4.&lt;/P&gt;&lt;P&gt;WRITE / p5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Bharat Kalagara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:22:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716221#M629956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T05:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716222#M629957</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;PRE&gt;&lt;CODE&gt;split mainstring at ';' into string1 string2 string3 string4 string5.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716222#M629957</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-20T05:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716223#M629958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys thanks for your answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention that the number of strings is not set. The number changes. So I need smething a bit more flexible than the static solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:27:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716223#M629958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T05:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716224#M629959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;DATA: string(400) TYPE c VALUE 'abac;abdfa;adfa;adsf'.  " this is your string.&lt;/P&gt;&lt;P&gt;DATA: char1(400) TYPE c,&lt;/P&gt;&lt;P&gt;char2(400) TYPE c.&lt;/P&gt;&lt;P&gt;DATA: string1(400) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: y TYPE i.&lt;/P&gt;&lt;P&gt;DATA: num TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num = STRLEN( string ).&lt;/P&gt;&lt;P&gt;char1 = string.&lt;/P&gt;&lt;P&gt;string1 = string.&lt;/P&gt;&lt;P&gt;DO num TIMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SEARCH string FOR ';' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    SPLIT string AT ';' INTO char1 char2.&lt;/P&gt;&lt;P&gt;    y = y + 1.&lt;/P&gt;&lt;P&gt;    CLEAR: string.&lt;/P&gt;&lt;P&gt;    string = char2.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;field(400) type c,&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;CLEAR: char1 , char2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO y TIMES.&lt;/P&gt;&lt;P&gt;  SPLIT string1 AT ';' INTO char1 char2.&lt;/P&gt;&lt;P&gt;  itab-field = char1.&lt;/P&gt;&lt;P&gt;  write:/ itab-field.&lt;/P&gt;&lt;P&gt;  append itab.&lt;/P&gt;&lt;P&gt;  clear: string1.&lt;/P&gt;&lt;P&gt;  string1 = char2.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:31:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716224#M629959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-20T05:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716225#M629960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;split it once.. check if the first of the new strings is the same as the original string&lt;/P&gt;&lt;P&gt;if it is different, then split it again till it becomes the same &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run it in a loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 05:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716225#M629960</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-20T05:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Split string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716226#M629961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when the no. of occurrences of the string is unknow the , best, simple approach would be to use the following method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: string_tab type standard table of string .&lt;/P&gt;&lt;P&gt;data: temp_string type string .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refres: string_tab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split mainstring at ';' into table string_tab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at string_tab into temp_string .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do some processing of each split string .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear temp_string .&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2007 07:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-string/m-p/2716226#M629961</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2007-08-20T07:02:19Z</dc:date>
    </item>
  </channel>
</rss>

