<?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 from right in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880510#M1324796</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 table as destination when splitting:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: itab type table of string.
data: i_lines type i.
data: result_str type string.

split var1  at '-' into table itab.

"and get number of entries
describe table itab lines i_lines.

read table itab into result_str index i_lines. "and read last entry 
write result_str.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2009 06:56:52 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2009-07-10T06:56:52Z</dc:date>
    <item>
      <title>split from right</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880508#M1324794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to split a variable with a separator as - (hyphen),&lt;/P&gt;&lt;P&gt;the hyphen can be a anywhere in the string so i want to &lt;/P&gt;&lt;P&gt;split in a such a way that i want to take the word from the very right hand &lt;/P&gt;&lt;P&gt;side . pls help me out to how can i do&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose if the string is like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;company-code-date-centre&lt;/P&gt;&lt;P&gt;company-centre&lt;/P&gt;&lt;P&gt;company-code-centre.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from right need to split and take the word centre&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have used the code as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: text2(50) type c,
text3(53) type c, var1(55) type c.

var1 = wa_final-text1.
split var1  at '-' into text2 text3.
move text3 to wa_final-text3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this works only whereever it encounter the first hyphen ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance &lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 06:52:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880508#M1324794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-10T06:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: split from right</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880509#M1324795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;It is very simple.&lt;/P&gt;&lt;P&gt;Just read the documentation on SPLIT.&lt;/P&gt;&lt;P&gt;You can SPLIT at '-' into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now your last word will be the last record of the internal table.&lt;/P&gt;&lt;P&gt;Just determine the no of records in the internal table making use of DESCRIBE statement and then READ the last record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: text2(50) type c,
text3(53) type c, 
var1(55) type c.

types: begin of T_itab,
           text type char50,
         end of T_itab.

data: itab type standard table of t_itab.

data: wa  Type t_itab. 

data: cntr type sytabix.


var1 = wa_final-text1.

split var1 at '-' into itab.

describe table itab lines cntr.

read table itab into wa index cntr.

text3 =  wa-text.&lt;/CODE&gt;&lt;/PRE&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;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ankur Parab on Jul 10, 2009 12:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 06:55:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880509#M1324795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-10T06:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: split from right</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880510#M1324796</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 table as destination when splitting:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: itab type table of string.
data: i_lines type i.
data: result_str type string.

split var1  at '-' into table itab.

"and get number of entries
describe table itab lines i_lines.

read table itab into result_str index i_lines. "and read last entry 
write result_str.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 06:56:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/split-from-right/m-p/5880510#M1324796</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-07-10T06:56:52Z</dc:date>
    </item>
  </channel>
</rss>

