<?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: How to split the string? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856675#M669690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;suppose in ur selection screen the field is :&lt;/P&gt;&lt;P&gt;   S_name:raghu &lt;/P&gt;&lt;P&gt;code :&lt;/P&gt;&lt;P&gt; data : v_char type string.&lt;/P&gt;&lt;P&gt;    v_char  = s_name+0(1).Then v_char will have R&lt;/P&gt;&lt;P&gt;    v_char  = s_name+0(2).Then v_char will have RA&lt;/P&gt;&lt;P&gt;    v_charg = s_name+0(3).Then v_char will have RAG.&lt;/P&gt;&lt;P&gt;LIKE THIS YOU HAVE TO PROCEED.&lt;/P&gt;&lt;P&gt;  this CODING HELPS YOU.   Give marks if it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Sep 2007 10:28:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-24T10:28:18Z</dc:date>
    <item>
      <title>How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856668#M669683</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;Can anyone explain me with code how to separate the single character from the given input string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example: Input String str = 'RAGHU'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output should be: &lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;P&gt;RA&lt;/P&gt;&lt;P&gt;RAGH&lt;/P&gt;&lt;P&gt;RAGHU&lt;/P&gt;&lt;P&gt;RAGH&lt;/P&gt;&lt;P&gt;RAG&lt;/P&gt;&lt;P&gt;RA&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with code for above required output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:09:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856668#M669683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856669#M669684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRY THIS&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : TEXT(10) VALUE 'RAGHU',
       LEN TYPE I,
       POS TYPE I,
       LNG TYPE I,
       VCH(10).
LEN = STRLEN( TEXT ).
LNG = LEN * 2.
LNG = LNG - 1.
DO LNG TIMES.
IF SY-INDEX LE LEN.
POS = POS + 1.
ELSE.
POS = POS - 1.
ENDIF.
VCH = TEXT+0(POS).
WRITE : / VCH.
ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REGARDS&lt;/P&gt;&lt;P&gt;SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856669#M669684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856670#M669685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA: s TYPE string VALUE 'RAGHU',&lt;/P&gt;&lt;P&gt;      int TYPE i ,&lt;/P&gt;&lt;P&gt;      count type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int = STRLEN( s ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO int TIMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  count = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE:/ s(count).&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;DO int TIMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  count = int - sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE:/ s(count).&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;Rewards if useful...........&lt;/P&gt;&lt;P&gt;Minal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856670#M669685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856671#M669686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for replying me.Can you explain me the logic inside the Do Loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain me theoretically for below part of the code?What SY-IDNEX will returns?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-INDEX LE LEN.&lt;/P&gt;&lt;P&gt;POS = POS + 1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;POS = POS - 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;VCH = TEXT+0(POS).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:32:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856671#M669686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856672#M669687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data str type string.&lt;/P&gt;&lt;P&gt;data: len type i,&lt;/P&gt;&lt;P&gt;      I TYPE I.&lt;/P&gt;&lt;P&gt;str = 'RAGHU'.&lt;/P&gt;&lt;P&gt;len = strlen( str ).&lt;/P&gt;&lt;P&gt;I = 1.&lt;/P&gt;&lt;P&gt;do len times.&lt;/P&gt;&lt;P&gt;write :/1(I) str.&lt;/P&gt;&lt;P&gt;I = I + 1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;I = LEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do len times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write :/1(I) str.&lt;/P&gt;&lt;P&gt;I = I - 1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:34:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856672#M669687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856673#M669688</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;sy-index will give u the iteration number.&lt;/P&gt;&lt;P&gt;first of all in this program u are counting the length of the string and it was in variable LEN.&lt;/P&gt;&lt;P&gt;we are always printing the string from 0 index(1st character) to POS number of characters.&lt;/P&gt;&lt;P&gt;length is 5 so LNG = 5 * 2 = 10 and LNG = 10 - 1 = 9.and first sy-index = 1.so,1 &amp;lt;= 5 so POS = 0 + 1 = 1. it is printing the first char&lt;/P&gt;&lt;P&gt;second sy-index = 2.so,2 &amp;lt;= 5 so POS = 1 + 1 = 2. it is printing the first two chars&lt;/P&gt;&lt;P&gt;third sy-index = 3.so,3 &amp;lt;= 5 so POS = 2 + 1 = 3. it is printing the first three chars&lt;/P&gt;&lt;P&gt;forth sy-index = 4.so,4 &amp;lt;= 5 so POS = 3 + 1 = 4. it is printing the first four chars&lt;/P&gt;&lt;P&gt;fifth sy-index = 5.so,5 &amp;lt;= 5 so POS = 4 + 1 = 5. it is printing the first five chars&lt;/P&gt;&lt;P&gt;sixth sy-index = 6.so,6 &amp;gt; 5 so POS = 5 - 1 = 4. it is printing the first four chars&lt;/P&gt;&lt;P&gt;seventh sy-index = 7.so,7 &amp;gt; 5 so POS = 4 - 1 = 3. it is printing the first three chars&lt;/P&gt;&lt;P&gt;eighth sy-index = 8.so,8 &amp;gt; 5 so POS = 3 - 1 = 2. it is printing the first two chars&lt;/P&gt;&lt;P&gt;ninth sy-index = 9.so,9 &amp;gt; 5 so POS = 2 - 1 = 1. it is printing the first char&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 05:56:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856673#M669688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T05:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856674#M669689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in do loop sy-index is giving the counter of the loop . i.e. how much time it processes the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so from first to the last of the string it should increase 1 character printing in each loop pass.&lt;/P&gt;&lt;P&gt;But when it reaches last of the string it should decrease 1 character from the printing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so by i am adding one upto when the loop pass is reaching to the last. Then&lt;/P&gt;&lt;P&gt;I am subtracting from the total length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 08:30:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856674#M669689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T08:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856675#M669690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;suppose in ur selection screen the field is :&lt;/P&gt;&lt;P&gt;   S_name:raghu &lt;/P&gt;&lt;P&gt;code :&lt;/P&gt;&lt;P&gt; data : v_char type string.&lt;/P&gt;&lt;P&gt;    v_char  = s_name+0(1).Then v_char will have R&lt;/P&gt;&lt;P&gt;    v_char  = s_name+0(2).Then v_char will have RA&lt;/P&gt;&lt;P&gt;    v_charg = s_name+0(3).Then v_char will have RAG.&lt;/P&gt;&lt;P&gt;LIKE THIS YOU HAVE TO PROCEED.&lt;/P&gt;&lt;P&gt;  this CODING HELPS YOU.   Give marks if it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 10:28:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856675#M669690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T10:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the string?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856676#M669691</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;Really the code you given works fine.And I felt that the code given by you is good compared to others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yesterday I tried that code and understand myself.Its really coooooooooooool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for answering me with optimized code. &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2007 05:19:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-split-the-string/m-p/2856676#M669691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-26T05:19:02Z</dc:date>
    </item>
  </channel>
</rss>

