<?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: use ranges in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725130#M316239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i corrected the code which is below..&lt;/P&gt;&lt;P&gt;RANGES: r_course FOR hrp1001-sobid.&lt;/P&gt;&lt;P&gt;CLEAR r_course.&lt;/P&gt;&lt;P&gt;REFRESH r_course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT person_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r_course-high = person_tab-sobid.&lt;/P&gt;&lt;P&gt;r_course-low = person_tab-sobid.&lt;/P&gt;&lt;P&gt;r_course-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_course-option = 'BT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND r_course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objid begda endda&lt;/P&gt;&lt;P&gt;FROM hrp1001&lt;/P&gt;&lt;P&gt;INTO (wa_itab-objid,wa_itab-begda,wa_itab-endda)&lt;/P&gt;&lt;P&gt;WHERE plvar ='01'&lt;/P&gt;&lt;P&gt;AND otype = 'D'&lt;/P&gt;&lt;P&gt;AND relat = '020'&lt;/P&gt;&lt;P&gt;AND rsign = 'B'&lt;/P&gt;&lt;P&gt;AND objid IN r_course&lt;/P&gt;&lt;P&gt;AND begda LE sy-datum&lt;/P&gt;&lt;P&gt;AND endda GE sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs&lt;/P&gt;&lt;P&gt;Manas Ranjan Panda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Nov 2006 14:29:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-13T14:29:38Z</dc:date>
    <item>
      <title>use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725126#M316235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i use it write ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES: r_course FOR hrp1001-sobid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT person_tab.&lt;/P&gt;&lt;P&gt;    CLEAR r_course.&lt;/P&gt;&lt;P&gt;    REFRESH r_course.&lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt; r_course-high = hrp1001-sobid.&lt;/P&gt;&lt;P&gt;    r_course-low = hrp1001-sobid.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;    r_course-sign = 'I'.&lt;/P&gt;&lt;P&gt;    r_course-option = 'BT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt; APPEND r_course.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objid begda endda&lt;/P&gt;&lt;P&gt;   FROM  hrp1001&lt;/P&gt;&lt;P&gt;   INTO (wa_itab-objid,wa_itab-begda,wa_itab-endda)&lt;/P&gt;&lt;P&gt;    WHERE plvar ='01'&lt;/P&gt;&lt;P&gt;     AND otype = 'D'&lt;/P&gt;&lt;P&gt;     AND relat = '020'&lt;/P&gt;&lt;P&gt;     AND rsign = 'B'&lt;/P&gt;&lt;P&gt;     &amp;lt;b&amp;gt;AND objid IN r_course&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;     AND begda &amp;lt;= sy-datum&lt;/P&gt;&lt;P&gt;     AND endda =&amp;gt; sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thankes for answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Nov 2006 12:04:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725126#M316235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-12T12:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725127#M316236</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'm trying to understand your code because it's very confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;This code is wrong,&amp;lt;/u&amp;gt; you transfer the value from hrp1001, but where the select I checked the structure of PERSON_TAB and there isn't the field SOBID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT person_tab.
   CLEAR r_course.
   REFRESH r_course.               " Why're you refreshing the range
   r_course-high = hrp1001-sobid. " Where is the select
   r_course-low = hrp1001-sobid.
   r_course-sign = 'I'.
   r_course-option = 'BT'.
   APPEND r_course.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose you want write this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; REFRESH r_course.
LOOP AT person_tab.
   CLEAR r_course.
   r_course-high = hrp1001-sobid. " but where are you getting SOBID
   r_course-low = hrp1001-sobid.
   r_course-sign = 'I'.
   r_course-option = 'BT'.
   APPEND r_course.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please to open several post for the same problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Nov 2006 12:17:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725127#M316236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-12T12:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725128#M316237</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;If you use the REFRESH statement, the internal table gets emptied out.&lt;/P&gt;&lt;P&gt;So you probably have just the last record you added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove the REFRESH Statement and execute your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Meera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Nov 2006 14:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725128#M316237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-12T14:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725129#M316238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to not refreshing the table as the others have suggested, also consider that you are looping at person_tab, but assigning values from hrp1001-sobid. So the same values would be assigned each time anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are assigning the same value to both r_course-low and r_course-high, it would be better to test for equality on just r_course-low .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Nov 2006 18:05:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725129#M316238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-12T18:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725130#M316239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i corrected the code which is below..&lt;/P&gt;&lt;P&gt;RANGES: r_course FOR hrp1001-sobid.&lt;/P&gt;&lt;P&gt;CLEAR r_course.&lt;/P&gt;&lt;P&gt;REFRESH r_course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT person_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r_course-high = person_tab-sobid.&lt;/P&gt;&lt;P&gt;r_course-low = person_tab-sobid.&lt;/P&gt;&lt;P&gt;r_course-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_course-option = 'BT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND r_course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT objid begda endda&lt;/P&gt;&lt;P&gt;FROM hrp1001&lt;/P&gt;&lt;P&gt;INTO (wa_itab-objid,wa_itab-begda,wa_itab-endda)&lt;/P&gt;&lt;P&gt;WHERE plvar ='01'&lt;/P&gt;&lt;P&gt;AND otype = 'D'&lt;/P&gt;&lt;P&gt;AND relat = '020'&lt;/P&gt;&lt;P&gt;AND rsign = 'B'&lt;/P&gt;&lt;P&gt;AND objid IN r_course&lt;/P&gt;&lt;P&gt;AND begda LE sy-datum&lt;/P&gt;&lt;P&gt;AND endda GE sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs&lt;/P&gt;&lt;P&gt;Manas Ranjan Panda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2006 14:29:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725130#M316239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-13T14:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725131#M316240</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;Please check this code. it will help u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Define a range:

Ranges: r_field for &amp;lt;table&amp;gt;.

if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.

if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.

if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.

select * from &amp;lt;table&amp;gt; where field1 in r_field.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hlped kindly mark points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2006 14:34:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725131#M316240</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-11-13T14:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: use ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725132#M316241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I suppose u want to search / extract&lt;/P&gt;&lt;P&gt;   for OBJID values,&lt;/P&gt;&lt;P&gt;   which are contained in SOBID field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then do two changes :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a)   RANGES: r_course FOR &amp;lt;b&amp;gt;hrp1001-OBJID&amp;lt;/b&amp;gt;   &lt;/P&gt;&lt;P&gt;   (and not RANGES: r_course FOR hrp1001-sobid)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; b) write  hrp1001-sobid to r_course-high.&lt;/P&gt;&lt;P&gt;    write  hrp1001-sobid to r_course-low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Also remove the &lt;/P&gt;&lt;P&gt;   REFRESH r_course&lt;/P&gt;&lt;P&gt;  (bcos it is clearing all times, in the looop)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2006 14:42:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/use-ranges/m-p/1725132#M316241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-13T14:42:22Z</dc:date>
    </item>
  </channel>
</rss>

