<?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: compare value in ranges using IF in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263317#M1529224</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 this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: SKA1.
*
RANGES: R0_HKONT FOR SKA1-SAKNR.
RANGES: R1_HKONT FOR SKA1-SAKNR.
*
CLEAR: R0_HKONT.
R0_HKONT-LOW    = '0000241000'.
R0_HKONT-SIGN   = 'I'.
R0_HKONT-OPTION = 'EQ'.
APPEND R0_HKONT.
*
CLEAR: R1_HKONT.
R1_HKONT-LOW    = '0000889901'.
R1_HKONT-HIGH   = '0000889903'.
R1_HKONT-SIGN   = 'I'.
R1_HKONT-OPTION = 'BT'.
APPEND R1_HKONT.
*
SELECT * FROM SKA1 WHERE SAKNR IN R0_HKONT
                     AND SAKNR IN R1_HKONT.
*
  WRITE: / SKA1-SAKNR, 'is in R0 and R1'.
*
ENDSELECT.
*
* OR -&amp;gt;
* SELECT SINGLE  * FROM SKA1 WHERE SAKNR IN R0_HKONT
*                                 AND SAKNR IN R1_HKONT.
*
IF SY-SUBRC &amp;lt;&amp;gt; 0.
  WRITE: / 'R0 and R1 does not  match'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Oct 2010 07:12:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-06T07:12:26Z</dc:date>
    <item>
      <title>compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263309#M1529216</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;Need an  advice how to compare single value with ranges. For below code it return error &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incorrect logical expression: Comparison / SELECT-OPTION can only be&lt;/P&gt;&lt;P&gt;followed by "AND", "OR" or ")".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For eg.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   s_hkont = '2410000'

  r6_hkont-low  = '0000889901'.
  r6_hkont-high = '0000889903'.
  r6_hkont-sign = 'I'.
  r6_hkont-option = 'BT'.
  append r6_hkont.

IF s_hkont IN r6_hkont.
 STOP.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 05:50:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263309#M1529216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T05:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263310#M1529217</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;PRE&gt;&lt;CODE&gt;s_hkont = '2410000'
 
  r6_hkont-low  = '0000889901'.
  r6_hkont-high = '0000889903'.
  r6_hkont-sign = 'I'.
  r6_hkont-option = 'BT'.
  append r6_hkont.
 
IF s_hkont IN r6_hkont.
 STOP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always  select data in query using  either   r6_hkont OR  s_hkont and  match that data with other &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;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263310#M1529217</guid>
      <dc:creator>deepak_dhamat</dc:creator>
      <dc:date>2010-10-06T06:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263311#M1529218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you can loop through the table r6_hknot and then write your if condition inside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:03:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263311#M1529218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T06:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263312#M1529219</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 this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_hkont = '2410000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R6_HKONT-LOW  = '0000889901'.&lt;/P&gt;&lt;P&gt;r6_hkont-high = '0000889903'.&lt;/P&gt;&lt;P&gt;r6_hkont-sign = 'I'.&lt;/P&gt;&lt;P&gt;r6_hkont-option = 'BT'.&lt;/P&gt;&lt;P&gt;APPEND r6_hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF s_hkont-low IN r6_hkont.&lt;/P&gt;&lt;P&gt;  STOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263312#M1529219</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2010-10-06T06:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263313#M1529220</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;Since there will be multiple values in Select-option i think you have to loop on it and then compare it as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT s_hkont.
IF s_hkont-low IN r6_hkont or s_hkont-high IN r6_hkont.
STOP.
ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pawan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:06:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263313#M1529220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T06:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263314#M1529221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi thanks for the quick reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how about if s_hkont is also ranges data type, how to compare two ranges&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF s_hkont IN r5_hkont ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:28:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263314#M1529221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T06:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263315#M1529222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;you can loop through the r6_hknot table and check the values of s_hknot against r6_hknot values. like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at r6_hknot.&lt;/P&gt;&lt;P&gt;if s_hknot-low = r6_hknot-low or &lt;/P&gt;&lt;P&gt;if s_hknot-high = r6_hknot-high.&lt;/P&gt;&lt;P&gt;then your code.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263315#M1529222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T06:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263316#M1529223</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 it like this IF for select options :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if s_matnr-low in r_matnr or s_matnr-high in r_matnr .&lt;/P&gt;&lt;P&gt;code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its the same for both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is not much of a difference between ranges and select options.&lt;/P&gt;&lt;P&gt;select-options are used on selection screen and ranges for internally in the code.&lt;/P&gt;&lt;P&gt;both have same structure and both create internal tables.&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;Sakshi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 06:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263316#M1529223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T06:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263317#M1529224</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 this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: SKA1.
*
RANGES: R0_HKONT FOR SKA1-SAKNR.
RANGES: R1_HKONT FOR SKA1-SAKNR.
*
CLEAR: R0_HKONT.
R0_HKONT-LOW    = '0000241000'.
R0_HKONT-SIGN   = 'I'.
R0_HKONT-OPTION = 'EQ'.
APPEND R0_HKONT.
*
CLEAR: R1_HKONT.
R1_HKONT-LOW    = '0000889901'.
R1_HKONT-HIGH   = '0000889903'.
R1_HKONT-SIGN   = 'I'.
R1_HKONT-OPTION = 'BT'.
APPEND R1_HKONT.
*
SELECT * FROM SKA1 WHERE SAKNR IN R0_HKONT
                     AND SAKNR IN R1_HKONT.
*
  WRITE: / SKA1-SAKNR, 'is in R0 and R1'.
*
ENDSELECT.
*
* OR -&amp;gt;
* SELECT SINGLE  * FROM SKA1 WHERE SAKNR IN R0_HKONT
*                                 AND SAKNR IN R1_HKONT.
*
IF SY-SUBRC &amp;lt;&amp;gt; 0.
  WRITE: / 'R0 and R1 does not  match'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Dieter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 07:12:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263317#M1529224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T07:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: compare value in ranges using IF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263318#M1529225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;kont IN r6_hkont.
&amp;gt;  STOP.
&amp;gt; ENDIF.
&amp;gt; 
&amp;gt; &lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally with single value you can use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CHECK kont IN r6_hkont.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 07:17:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/compare-value-in-ranges-using-if/m-p/7263318#M1529225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T07:17:06Z</dc:date>
    </item>
  </channel>
</rss>

