<?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 variable offset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846675#M359105</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 variable X = '&amp;gt;HARI&amp;lt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search itab_filein-record for c_left_bracket.&lt;/P&gt;&lt;P&gt;l_length = sy-fdpos.&lt;/P&gt;&lt;P&gt;move itab_filein-record(l_length) to samp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now samp contains '&amp;gt;HARI' since sy-fdpos returns 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to avoid first character in this case. The samp should be only HARI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jan 2007 11:26:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-16T11:26:36Z</dc:date>
    <item>
      <title>variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846675#M359105</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 variable X = '&amp;gt;HARI&amp;lt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search itab_filein-record for c_left_bracket.&lt;/P&gt;&lt;P&gt;l_length = sy-fdpos.&lt;/P&gt;&lt;P&gt;move itab_filein-record(l_length) to samp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now samp contains '&amp;gt;HARI' since sy-fdpos returns 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to avoid first character in this case. The samp should be only HARI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ratna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846675#M359105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846676#M359106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this out  - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data l_data(10) .&lt;/P&gt;&lt;P&gt;data a type i.&lt;/P&gt;&lt;P&gt;data len type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_data = '&amp;gt;HARI&amp;lt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;search l_data for '&amp;lt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a = sy-fdpos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace '&amp;gt;' with '' into l_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: l_data(a).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:28:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846676#M359106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846677#M359107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : len type i,&lt;/P&gt;&lt;P&gt;         pos type i,&lt;/P&gt;&lt;P&gt;         vchar(1),&lt;/P&gt;&lt;P&gt;         string2(20).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute len = strlen( str1 ).&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;vchar = str1+pos(1).&lt;/P&gt;&lt;P&gt;if vchar ne '&amp;lt;' or vchar ne '&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate str2 vchar into str2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;pos = pos + 1.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now str2 contains the required thing&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>Tue, 16 Jan 2007 11:32:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846677#M359107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846678#M359108</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;Once  you get '&amp;gt;HARI' into samp,&lt;/P&gt;&lt;P&gt;replace '&amp;gt;' with '' into samp.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846678#M359108</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2007-01-16T11:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846679#M359109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ratna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER : str1(20) .&lt;/P&gt;&lt;P&gt;DATA : v2(20),&lt;/P&gt;&lt;P&gt;           d TYPE i,&lt;/P&gt;&lt;P&gt;           e TYPE i,&lt;/P&gt;&lt;P&gt;           f type i.&lt;/P&gt;&lt;P&gt;DATA : check1(26) VALUE 'abcdefghijklmnopqrstuvwxyz',&lt;/P&gt;&lt;P&gt;           check2(26) VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. &lt;/P&gt;&lt;P&gt;d = 0.&lt;/P&gt;&lt;P&gt;e = 0. &lt;/P&gt;&lt;P&gt;*str1 = '&amp;gt;HARI&amp;lt;'.&lt;/P&gt;&lt;P&gt;f = strlen( str1 ). &lt;/P&gt;&lt;P&gt;WHILE d NE f. &lt;/P&gt;&lt;P&gt;  IF str1&lt;EM&gt;d(1) CA check1 OR str1&lt;/EM&gt;d(1) CA check2.&lt;/P&gt;&lt;P&gt;     v2&lt;EM&gt;e(1) = str1&lt;/EM&gt;d(1).&lt;/P&gt;&lt;P&gt;     d = d + 1.&lt;/P&gt;&lt;P&gt;     e = e + 1.&lt;/P&gt;&lt;P&gt;   ELSE.&lt;/P&gt;&lt;P&gt;     d = d + 1.&lt;/P&gt;&lt;P&gt;     continue.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDWHILE. &lt;/P&gt;&lt;P&gt;write : / v2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:42:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846679#M359109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846680#M359110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the output with input &amp;gt;HARI&amp;lt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters : val(10)  type c.
data : final(10) type c,
       cnt type i,
       v type c,
       n type i.

cnt = strlen( val ).
do cnt times.
move val+n(1) to v.
if v ca '&amp;lt;&amp;gt;0123456789'.  "----&amp;gt;increase ur criteria with '*,.:" and so on
else.
move v to final+n(1).
endif.
n = n + 1.
enddo.

condense final no-gaps.
start-of-selection.
write:/ final.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 11:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846680#M359110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T11:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: variable offset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846681#M359111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ratna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is probabaly the easiest way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the bracket is allways in first position you can simply add a startposition in the move statemnet (+1). do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;move itab_filein-record&amp;lt;b&amp;gt;+1&amp;lt;/b&amp;gt;(l_length) to samp.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you have to dynamically determine the startposition of the substring to be copied look at this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: str_a(10) value 'joris bots',     "source string
      str_b(10), "destination string
      i type integer,  " start position of copy
                            " strlen type integer. strlength to be copied

i := 1.          " determine startposition
strlen = 10.  " determine length of string
strlen = strlen - i. " correct length with startposition 
                          "  (not needed if strlen does not exceed total length.

move str_a+i(strlen) to str_b.    " no do the final move starting at position i, 
                                              " never exceeding the length of the source string
                                              " no dumps or syntax errors etc
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this example should produce:&lt;/P&gt;&lt;P&gt;str_b = 'oris bots'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joris Bots&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2007 12:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable-offset/m-p/1846681#M359111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-16T12:25:59Z</dc:date>
    </item>
  </channel>
</rss>

