<?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: Rotating a character or string data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912643#M379787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this code samepl&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: string11(15) type c.
CALL FUNCTION 'STRING_REVERSE'
  EXPORTING
    string          =  'TEST PROGRAM'
    lang            =  'E'
 IMPORTING
   RSTRING         =  string11
* EXCEPTIONS
*   TOO_SMALL       = 1
*   OTHERS          = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Write:/ string11.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ALPHABET(10) VALUE 'ABCDEFGHIJ', 
      THREE(3)     VALUE    'DEF', 
      FOUR(4)      VALUE    'DEF '. 
SHIFT ALPHABET UP TO FOUR. 

SY-SUBRC is now set to 4, and the field ALPHABET remains unchanged. 

SHIFT ALPHABET UP TO THREE CIRCULAR. 

SY-SUBRC is now set to 0 and ALPHABET has the contents 'DEFGHIJABC'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ALPHA1(11) TYPE C VALUE 'ABCDEFGHIJ', 
      ALPHA2     TYPE STRING. 
ALPHA2 = ALPHA1. 
SHIFT ALPHA1 CIRCULAR. 
SHIFT ALPHA2 CIRCULAR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;ALPHA1 now has the contents 'BCDEFGHIJ A' and ALPHA2 the contents 'BCDEFGHIJA'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Judith Jessie Selvi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Feb 2007 04:40:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-22T04:40:49Z</dc:date>
    <item>
      <title>Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912638#M379782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a key word or function module in ABAP which rotates a character or a string data. For example if the data is 'SAP', I should get it as 'PAS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aravind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912638#M379782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912639#M379783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : str(3) type c value 'PAS',&lt;/P&gt;&lt;P&gt;         str1(3) type c,&lt;/P&gt;&lt;P&gt;         len type i,&lt;/P&gt;&lt;P&gt;         pos type i,&lt;/P&gt;&lt;P&gt;         len1 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = strlen( str ).&lt;/P&gt;&lt;P&gt;len1 = len.&lt;/P&gt;&lt;P&gt;len = len - 1.&lt;/P&gt;&lt;P&gt;do len1 times.&lt;/P&gt;&lt;P&gt;str1&lt;EM&gt;pos(1) = str&lt;/EM&gt;len(1).&lt;/P&gt;&lt;P&gt;pos = pos + 1.&lt;/P&gt;&lt;P&gt;len = len - 1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;write : / str1.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912639#M379783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912640#M379784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Use function module STRING_REVERSE

or u can use.

data : c(5) value 'ABCDE'.
data : l type i,i type i value -1.
data : str(5) .
l = strlen( c ).

do l times.
i = i + 1.
l = l - 1.
STR+i(1) = C+l(1).
enddo.
write STR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:31:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912640#M379784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912641#M379785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;USe:&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SHIFT C CIRCULAR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Shifts C cyclically, that is, the character that is pushed out&lt;/P&gt;&lt;P&gt; is reinserted at the other end of the string. You can use this&lt;/P&gt;&lt;P&gt; addition with both the RIGHT and LEFT additions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: ALPHA1(11) TYPE C VALUE 'ABCDEFGHIJ',&lt;/P&gt;&lt;P&gt;       ALPHA2     TYPE STRING.&lt;/P&gt;&lt;P&gt; ALPHA2 = ALPHA1.&lt;/P&gt;&lt;P&gt; SHIFT ALPHA1 CIRCULAR.&lt;/P&gt;&lt;P&gt; SHIFT ALPHA2 CIRCULAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ALPHA1 now has the contents 'BCDEFGHIJ A' and  ALPHA2 the&lt;/P&gt;&lt;P&gt; contents 'BCDEFGHIJA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,.&lt;/P&gt;&lt;P&gt;Sipra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912641#M379785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912642#M379786</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 this FM STRING_REVERSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pass the value to string &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:32:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912642#M379786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating a character or string data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912643#M379787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this code samepl&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: string11(15) type c.
CALL FUNCTION 'STRING_REVERSE'
  EXPORTING
    string          =  'TEST PROGRAM'
    lang            =  'E'
 IMPORTING
   RSTRING         =  string11
* EXCEPTIONS
*   TOO_SMALL       = 1
*   OTHERS          = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Write:/ string11.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ALPHABET(10) VALUE 'ABCDEFGHIJ', 
      THREE(3)     VALUE    'DEF', 
      FOUR(4)      VALUE    'DEF '. 
SHIFT ALPHABET UP TO FOUR. 

SY-SUBRC is now set to 4, and the field ALPHABET remains unchanged. 

SHIFT ALPHABET UP TO THREE CIRCULAR. 

SY-SUBRC is now set to 0 and ALPHABET has the contents 'DEFGHIJABC'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ALPHA1(11) TYPE C VALUE 'ABCDEFGHIJ', 
      ALPHA2     TYPE STRING. 
ALPHA2 = ALPHA1. 
SHIFT ALPHA1 CIRCULAR. 
SHIFT ALPHA2 CIRCULAR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;ALPHA1 now has the contents 'BCDEFGHIJ A' and ALPHA2 the contents 'BCDEFGHIJA'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Judith Jessie Selvi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2007 04:40:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/rotating-a-character-or-string-data/m-p/1912643#M379787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-22T04:40:49Z</dc:date>
    </item>
  </channel>
</rss>

