<?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: Shift in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466752#M219774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have opened two threads for the same question.  Please close one and continue with the other. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the string length and move to the appropriate variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: str1 type string.

data: var1(18) type c.
data: var2(13) type c.

data: len type i.


str1 = 'ABCDEFGHIJK'.

len = strlen( str1 ).

if len &amp;gt; 13.
  var1 = str1.
else.
  var2 = str1.
endif.


write:/ var1.
write:/ var2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jul 2006 14:20:40 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-07-25T14:20:40Z</dc:date>
    <item>
      <title>Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466746#M219768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI group,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having one field called v_ref with length of 18 .&lt;/P&gt;&lt;P&gt;This filed sometimes coming with length 10 and others&lt;/P&gt;&lt;P&gt;spaces in the right handside.Some times with length 13 &lt;/P&gt;&lt;P&gt;and other 5 spaces.I need to populated this field in to &lt;/P&gt;&lt;P&gt;some other fileld without any spaces,could you please&lt;/P&gt;&lt;P&gt;suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:09:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466746#M219768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T14:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466747#M219769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You want to remove the spaces on the right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shift v_ref right deleting trailing space.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466747#M219769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T14:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466748#M219770</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;Try to use &amp;lt;b&amp;gt;condense &amp;lt;var&amp;gt; no-gaps&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466748#M219770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466749#M219771</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;shift v_ref right deleting trailing space.&lt;/P&gt;&lt;P&gt;shift v_ref left  deleting leading space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move v_ref to l_ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Naimesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:13:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466749#M219771</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2006-07-25T14:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466750#M219772</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;SHIFT V_VAL LEFT DELETING LEADING SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;do reward if it helps,&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:14:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466750#M219772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T14:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466751#M219773</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 shift the contents of a field using the following variants of the SHIFT statement. SHIFT moves field contents character by character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shifting a String by a Given Number of Positions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT &amp;lt;c&amp;gt; [BY &amp;lt;n&amp;gt; PLACES] [&amp;lt;mode&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement shifts the field &amp;lt;c&amp;gt; by &amp;lt;n&amp;gt; positions. If you omit BY &amp;lt;n&amp;gt; PLACES, &amp;lt;n&amp;gt; is interpreted as one. If &amp;lt;n&amp;gt; is 0 or negative, &amp;lt;c&amp;gt; remains unchanged. If &amp;lt;n&amp;gt; exceeds the length of &amp;lt;c&amp;gt;, &amp;lt;c&amp;gt; is filled out with blanks. &amp;lt;n&amp;gt; can be variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the different &amp;lt;mode&amp;gt; options, you can shift the field &amp;lt;c&amp;gt; in the following ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mode&amp;gt; is LEFT: &lt;/P&gt;&lt;P&gt;Shifts the field contents &amp;lt;n&amp;gt; places to the left and adds &amp;lt;n&amp;gt; blanks at the right-hand end of the field (default).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mode&amp;gt; is RIGHT:&lt;/P&gt;&lt;P&gt;Shift &amp;lt;n&amp;gt; positions to the right and adds &amp;lt;n&amp;gt; blanks at the left-hand end of the field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;mode&amp;gt; is CIRCULAR:&lt;/P&gt;&lt;P&gt;Shift &amp;lt;n&amp;gt; positions to the left so that &amp;lt;n&amp;gt; characters on the left appear on the right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T(10) VALUE 'abcdefghij',&lt;/P&gt;&lt;P&gt;STRING LIKE T.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;WRITE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT STRING.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING BY 3 PLACES LEFT.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING BY 3 PLACES RIGHT.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING BY 3 PLACES CIRCULAR.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abcdefghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bcdefghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   abcdefg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defghijabc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shifting a Structure up to a Given String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT &amp;lt;c&amp;gt; UP TO &amp;lt;str&amp;gt; &amp;lt;mode&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement searches the field contents of &amp;lt;c&amp;gt; until it finds the string &amp;lt;str&amp;gt; and shifts the field &amp;lt;c&amp;gt; up to the edge of the field. The &amp;lt;mode&amp;gt; options are the same as described above. &amp;lt;str&amp;gt; can be a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If &amp;lt;str&amp;gt; is not found in &amp;lt;c&amp;gt;, SY-SUBRC is set to 4 and &amp;lt;c&amp;gt; is not shifted. Otherwise, SY-SUBRC is set to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T(10) VALUE 'abcdefghij',&lt;/P&gt;&lt;P&gt;STRING LIKE T,&lt;/P&gt;&lt;P&gt;STR(2) VALUE 'ef'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;WRITE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT STRING UP TO STR.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING UP TO STR LEFT.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING UP TO STR RIGHT.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING UP TO STR CIRCULAR.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abcdefghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;efghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;efghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    abcdef&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;efghijabcd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shifting a Structure According to the First or Last Character&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT &amp;lt;c&amp;gt; LEFT DELETING LEADING &amp;lt;str&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT &amp;lt;c&amp;gt; RIGHT DELETING TRAILING &amp;lt;str&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement shifts the field &amp;lt;c&amp;gt; to the left or to the right, provided the first character on the left or the last character on the right occur in &amp;lt;str&amp;gt;. The right or left of the field is then padded with blanks. &amp;lt;str&amp;gt; can be a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T(14) VALUE ' abcdefghij',&lt;/P&gt;&lt;P&gt;STRING LIKE T,&lt;/P&gt;&lt;P&gt;STR(6) VALUE 'ghijkl'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;WRITE STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SHIFT STRING LEFT DELETING LEADING SPACE.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRING = T.&lt;/P&gt;&lt;P&gt;SHIFT STRING RIGHT DELETING TRAILING STR.&lt;/P&gt;&lt;P&gt;WRITE / STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    abcdefghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abcdefghij&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        abcdef&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;Laxmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466751#M219773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T14:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Shift</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466752#M219774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have opened two threads for the same question.  Please close one and continue with the other. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the string length and move to the appropriate variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: str1 type string.

data: var1(18) type c.
data: var2(13) type c.

data: len type i.


str1 = 'ABCDEFGHIJK'.

len = strlen( str1 ).

if len &amp;gt; 13.
  var1 = str1.
else.
  var2 = str1.
endif.


write:/ var1.
write:/ var2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 14:20:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/shift/m-p/1466752#M219774</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-25T14:20:40Z</dc:date>
    </item>
  </channel>
</rss>

