<?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: Splitting string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249765#M775845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasy,&lt;/P&gt;&lt;P&gt;You can split the string with use of &lt;/P&gt;&lt;P&gt;String+offset(length).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here offset is the starting position and length is no. of characters starting from offset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example string is X and other 3 fields are l1, l2, l3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l1 = X+0(10).&lt;/P&gt;&lt;P&gt;l2 = X+10(12).&lt;/P&gt;&lt;P&gt;l3 = X+22(4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do Like tHis..&lt;/P&gt;&lt;P&gt;Data: string(28) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = string+0(10).&lt;/P&gt;&lt;P&gt;itab-field2 = string+10(12).&lt;/P&gt;&lt;P&gt;itab-field3 = string+22(4).&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise if any seperaters are there in the string u can do like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split string at '/' itab-f1 itab-f2 itab-f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2008 05:21:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-14T05:21:25Z</dc:date>
    <item>
      <title>Splitting string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249763#M775843</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 have a string. Length can vary b/w 0 and 900. I would like to split this string into variables l1,l2,l3,l4. l1,l2,l3,l4 are of length 250. Please tell me how this can be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prasy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 05:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249763#M775843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T05:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249764#M775844</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 statement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT f AT g INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :  begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;              text(250)  type c,&lt;/P&gt;&lt;P&gt;          end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT  string1  AT ','  INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;   write : / itab-text.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;each value will be stored as seperate record in the itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 05:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249764#M775844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T05:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249765#M775845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasy,&lt;/P&gt;&lt;P&gt;You can split the string with use of &lt;/P&gt;&lt;P&gt;String+offset(length).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here offset is the starting position and length is no. of characters starting from offset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example string is X and other 3 fields are l1, l2, l3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l1 = X+0(10).&lt;/P&gt;&lt;P&gt;l2 = X+10(12).&lt;/P&gt;&lt;P&gt;l3 = X+22(4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do Like tHis..&lt;/P&gt;&lt;P&gt;Data: string(28) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab-field1 = string+0(10).&lt;/P&gt;&lt;P&gt;itab-field2 = string+10(12).&lt;/P&gt;&lt;P&gt;itab-field3 = string+22(4).&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise if any seperaters are there in the string u can do like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;split string at '/' itab-f1 itab-f2 itab-f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 05:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249765#M775845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T05:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249766#M775846</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;You can split the string as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*step1: create a required structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_split_string,&lt;/P&gt;&lt;P&gt;  l1(250) TYPE c,&lt;/P&gt;&lt;P&gt;  l2(250) TYPE c,&lt;/P&gt;&lt;P&gt;  l3(250) TYPE c,&lt;/P&gt;&lt;P&gt;  l4(250) TYPE c,&lt;/P&gt;&lt;P&gt;  END OF ty_split_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_string(900) TYPE c,&lt;/P&gt;&lt;P&gt;        ls_split_string TYPE ty_split_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*step2: Initialize the string which is to be splitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_string = '101 Mary Jones   UK   2000$'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*step3: work area ls_split_string will now containg the string which is splitted at required positions&lt;/P&gt;&lt;P&gt;  ls_split_string = l_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write: ls_split_string-l1, ls_split_string-l2, ls_split_string-l3, ls_split_string-l4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_split_string,&lt;/P&gt;&lt;P&gt;  l1(25) TYPE c,&lt;/P&gt;&lt;P&gt;  l2(25) TYPE c,&lt;/P&gt;&lt;P&gt;  l3(25) TYPE c,&lt;/P&gt;&lt;P&gt;  l4(25) TYPE c,&lt;/P&gt;&lt;P&gt;  END OF ty_split_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_string(90) TYPE c,&lt;/P&gt;&lt;P&gt;      ls_split_string TYPE ty_split_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Initialize the string: for Example:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;l_string = 'aaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccddddddddddddddd'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_split_string = l_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE /: 'l1:', ls_split_string-l1.&lt;/P&gt;&lt;P&gt;WRITE /:  'l2:', ls_split_string-l2 .&lt;/P&gt;&lt;P&gt;WRITE /:  'l3:', ls_split_string-l3 .&lt;/P&gt;&lt;P&gt;WRITE /:  'l4:', ls_split_string-l4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls do reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Farheen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Farheen Fatima on Jan 14, 2008 7:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 05:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249766#M775846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T05:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249767#M775847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Check the possible String operations..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;shifting up to a given string&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t2(10) TYPE c VALUE 'abcdefghij',&lt;/P&gt;&lt;P&gt;      string2 LIKE t2,&lt;/P&gt;&lt;P&gt;      str2(2) TYPE c VALUE 'ef'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string2 = t2.&lt;/P&gt;&lt;P&gt;WRITE string2.&lt;/P&gt;&lt;P&gt;SHIFT string2 UP TO str2.&lt;/P&gt;&lt;P&gt;WRITE / string2.&lt;/P&gt;&lt;P&gt;string2 = t2.&lt;/P&gt;&lt;P&gt;SHIFT string2 UP TO str2 LEFT.&lt;/P&gt;&lt;P&gt;WRITE / string2.&lt;/P&gt;&lt;P&gt;string2 = t2.&lt;/P&gt;&lt;P&gt;SHIFT string2  UP TO str2 RIGHT.&lt;/P&gt;&lt;P&gt;WRITE / string2.&lt;/P&gt;&lt;P&gt;string2 = t2.&lt;/P&gt;&lt;P&gt;SHIFT string2  UP TO str2 CIRCULAR.&lt;/P&gt;&lt;P&gt;WRITE / string2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;shifting a string depending on the first or last sign&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t3(14) TYPE c VALUE '    abcdefghij',&lt;/P&gt;&lt;P&gt;      string3 LIKE t3,&lt;/P&gt;&lt;P&gt;      str3(6) TYPE c VALUE 'ghijkl'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string3 = t3.&lt;/P&gt;&lt;P&gt;WRITE string3.&lt;/P&gt;&lt;P&gt;SHIFT string3 LEFT DELETING LEADING space.&lt;/P&gt;&lt;P&gt;WRITE / string3.&lt;/P&gt;&lt;P&gt;string3 = t3.&lt;/P&gt;&lt;P&gt;SHIFT string3 RIGHT DELETING TRAILING str3.&lt;/P&gt;&lt;P&gt;WRITE / string3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;ULINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2008 05:48:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/splitting-string/m-p/3249767#M775847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-14T05:48:25Z</dc:date>
    </item>
  </channel>
</rss>

