<?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: Using IN in IF statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946339#M389983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William :&lt;/P&gt;&lt;P&gt;    This could solve your problem .&lt;/P&gt;&lt;P&gt;select-options cannt have variable names more than 8 characters .&lt;/P&gt;&lt;P&gt; data : v_hkont like bseg-hkont.&lt;/P&gt;&lt;P&gt;select-options :&lt;/P&gt;&lt;P&gt; s_var for v_hkont default '0010000' to '0020000',&lt;/P&gt;&lt;P&gt; s_var2 for v_hkont default '0020001' to '0030000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; v_hkont = '0025000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_hkont IN s_var or v_hkont IN s_var2.&lt;/P&gt;&lt;P&gt;    write 'hi' .&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;    write 'bye'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2007 05:10:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-02T05:10:59Z</dc:date>
    <item>
      <title>Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946337#M389981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem using the IN syntax in IF statements. Below is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data                   : v_hkont like bseg-hkont. &lt;/P&gt;&lt;P&gt;selection-options : s_variable for bseg-hkont default '0010000' to '0020000',&lt;/P&gt;&lt;P&gt;                            s_variable2 for bseg-hkont default '0020001' to '0030000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_hkont = '0025000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_hkont IN s_variable or v_hkont IN s_variable2.&lt;/P&gt;&lt;P&gt;  "do something.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think is this the right way to use the syntax IN in IF statement for this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because i need to do such scenario and i find the IF statement with IN syntax is not working correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;William Wilstroth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:02:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946337#M389981</guid>
      <dc:creator>Wil_Wilstroth</dc:creator>
      <dc:date>2007-03-02T05:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946338#M389982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Guess the code seems to be fine and you can use IN statement in IF statement. I have used it that way and it has worked for me in the past.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:06:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946338#M389982</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T05:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946339#M389983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William :&lt;/P&gt;&lt;P&gt;    This could solve your problem .&lt;/P&gt;&lt;P&gt;select-options cannt have variable names more than 8 characters .&lt;/P&gt;&lt;P&gt; data : v_hkont like bseg-hkont.&lt;/P&gt;&lt;P&gt;select-options :&lt;/P&gt;&lt;P&gt; s_var for v_hkont default '0010000' to '0020000',&lt;/P&gt;&lt;P&gt; s_var2 for v_hkont default '0020001' to '0030000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; v_hkont = '0025000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_hkont IN s_var or v_hkont IN s_var2.&lt;/P&gt;&lt;P&gt;    write 'hi' .&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;    write 'bye'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946339#M389983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T05:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946340#M389984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Yes thats the correct way ,  

tr this..

s_variable-sign = 'I'.
s_variable-option = 'BT'.
s_variable-low = '0000200001'.
s_variable-high = '0000300000'.
append s_variable

and use this in IF&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:12:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946340#M389984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T05:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946341#M389985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your declaration is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to select-options not selection-options.&lt;/P&gt;&lt;P&gt;and the select options variable should not be more than 8 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have modified your code. see below it is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bseg.&lt;/P&gt;&lt;P&gt;data : v_hkont like bseg-hkont. &lt;/P&gt;&lt;P&gt;select-options : s_var for bseg-hkont default '0010000' to '0020000',&lt;/P&gt;&lt;P&gt;s_var1 for bseg-hkont default '0020001' to '0030000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_hkont = '0025000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if v_hkont IN s_var or v_hkont IN s_var1.&lt;/P&gt;&lt;P&gt;"do something.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:13:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946341#M389985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T05:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946342#M389986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;EXAMPLE&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; IF ( v_reqdate BETWEEN s_rdate-low AND s_rdate-high )&lt;/P&gt;&lt;P&gt;    OR v_reqdate EQ s_rdate-low OR s_rdate IS INITIAL.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change u r code like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : v_hkont like bseg-hkont.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select-options : s_var for bseg-hkont default '0010000' to '0020000',&lt;/P&gt;&lt;P&gt;s_var2 for bseg-hkont default '0020001' to '0030000'.&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;v_hkont = '0025000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if ( ( v_hkont BETWEEN s_var-low AND s_var-high ) or ( v_hkont BETWEEN s_var2-low AND s_var2-high ) ).&lt;/P&gt;&lt;P&gt;"do something.&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 05:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946342#M389986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-02T05:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using IN in IF statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946343#M389987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, i make a mistake in my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got it mix up. I am supposed to ask why i can't use IN with range using NO INTERVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very happy that everyone contributed to my problem. Of course all your answer will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just got confused with the range using NO INTERVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have figured this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF i declared&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options : s_v1 for bseg-hkont default '0000100000' NO INTERVAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot use IN in IF statement but i should use EQ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing, you guys are particular with my declaration. Everyone is sharp!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciated &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;William Wilstroth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2007 06:08:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-in-in-if-statements/m-p/1946343#M389987</guid>
      <dc:creator>Wil_Wilstroth</dc:creator>
      <dc:date>2007-03-02T06:08:11Z</dc:date>
    </item>
  </channel>
</rss>

