<?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: if statement with IN and bracket in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042302#M1500855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ABAP it is not possible this way. What I usually do instead is&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
case p_wears.
   when 'EUR' or 'AUD' or 'NZD' or 'GBP'.
      ...
   when others.
     ..
endcase.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jun 2010 06:52:19 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2010-06-30T06:52:19Z</dc:date>
    <item>
      <title>if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042299#M1500852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear forum,&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;can the below if statement &lt;/P&gt;&lt;P&gt; if p_waers = 'EUR' or p_waers = 'AUD' or p_waers = 'NZD' or p_waers = 'GBP'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change to &lt;/P&gt;&lt;P&gt;if p_waers IN ( 'EUR'  , 'AUD' , 'NZD' ) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried but not possible. why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 06:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042299#M1500852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T06:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042300#M1500853</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;It is because you do not read help for &lt;STRONG&gt;Logical&lt;/STRONG&gt; &lt;STRONG&gt;Expressions&lt;/STRONG&gt; &lt;STRONG&gt;-&lt;/STRONG&gt; &lt;STRONG&gt;Comparison&lt;/STRONG&gt; &lt;STRONG&gt;with&lt;/STRONG&gt; &lt;STRONG&gt;a&lt;/STRONG&gt; &lt;STRONG&gt;Selection&lt;/STRONG&gt; &lt;STRONG&gt;Criterion&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You need to create ranges for waers, fill it with your waers and in IF statement compare with ranges.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 06:48:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042300#M1500853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T06:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042301#M1500854</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 populate all the values in to a range variable and then you can use IN. Answer for Why is, it is the way ABAP language syntax was created by SAP &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r_waers-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_waers-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r_waers-low = 'EUR'.&lt;/P&gt;&lt;P&gt;APPEND r_waers.&lt;/P&gt;&lt;P&gt;r_waers-low = 'AUD'.&lt;/P&gt;&lt;P&gt;APPEND r_waers.&lt;/P&gt;&lt;P&gt;r_waers-low = 'NZD'.&lt;/P&gt;&lt;P&gt;APPEND r_waers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF p_waers IN r_waers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 06:49:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042301#M1500854</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-06-30T06:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042302#M1500855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ABAP it is not possible this way. What I usually do instead is&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
case p_wears.
   when 'EUR' or 'AUD' or 'NZD' or 'GBP'.
      ...
   when others.
     ..
endcase.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 06:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042302#M1500855</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-06-30T06:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042303#M1500856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the IN logical operator requires a comparision against a select-option type structure, so would require something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: l_waers type waers.

select-options s_waers for l_waers no-display.


s_waers-sign   = 'I'. 
s_waers-option = 'EQ'. 
s_waers-low    = 'EUR'. 
APPEND s_waers TO s_waers.

s_waers-sign   = 'I'. 
s_waers-option = 'EQ'. 
s_waers-low    = 'AUD'. 
APPEND s_waers TO s_waers.

s_waers-sign   = 'I'. 
s_waers-option = 'EQ'. 
s_waers-low    = 'NZD
APPEND s_waers TO s_waers.

if p_waers in s_waers.



endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However a quicker alternative may be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if 'EUR AUD NZD' CS p_waers then.

endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 06:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042303#M1500856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T06:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042304#M1500857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;replace&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if p_waers IN ( 'EUR' , 'AUD' , 'NZD' ) &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if p_waers IN ('EUR','AUD','NZD') &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(same code without spaces inside the brackets)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 07:45:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042304#M1500857</guid>
      <dc:creator>former_member194797</dc:creator>
      <dc:date>2010-06-30T07:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042305#M1500858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason why &lt;STRONG&gt;IN&lt;/STRONG&gt; keyword does not work for you is that it can be used with &lt;STRONG&gt;WHERE&lt;/STRONG&gt; keyword, but not with &lt;STRONG&gt;IF&lt;/STRONG&gt; keyword.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 08:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042305#M1500858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T08:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042306#M1500859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI,&lt;/P&gt;&lt;P&gt;Its always recommended to use CASE ... END CASE  in this situation..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 08:41:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042306#M1500859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T08:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042307#M1500860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henri, &lt;/P&gt;&lt;P&gt;I was surprised at this solution but I thought I would give it a go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find that this code does not compile:&lt;/P&gt;&lt;P&gt;if p_waers IN ('EUR','AUD','NZD'). &lt;/P&gt;&lt;P&gt;with or without spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best solution here is to use a ranges object as &lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/vinod.vemuru2" id="jive-38170623261962610504240"&gt;Vinod Vemuru&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; correctly describes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately&amp;nbsp; &lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/manish.kumar19" id="jive-13328523261962951805240"&gt;Manish Kumar&lt;/A&gt;&amp;nbsp; &lt;/STRONG&gt;you can use in with an if and &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://answers.sap.com/people/suraj.nair" id="jive-24302723261962997640240"&gt;Suraj Nair&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; it is not always recommended to use a case statement in this situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 01:32:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042307#M1500860</guid>
      <dc:creator>NigelJames180</dc:creator>
      <dc:date>2013-05-14T01:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042308#M1500861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends on the intended usage of IN keyword.&lt;/P&gt;&lt;P&gt;IN keyword can be used with values like IN ('EUR','AUD','NZD') or selection table.&lt;/P&gt;&lt;P&gt;Within an IF, IN can be used if you are using selection table, and not if you are using values list.&lt;/P&gt;&lt;P&gt;Within SELECT..WHERE, IN ('EUR','AUD','NZD') will work.&lt;/P&gt;&lt;P&gt;Creating a range table for matching a fixed list of values in IF statement isn't worth the effort.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 03:46:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042308#M1500861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-05-14T03:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with IN and bracket</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042309#M1500862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes abap is a little inconsistent at the best of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether a range table is worth the effort is a case by case basis. I would say it is much better than a case statement given that there is no breaking from a case and fall through that you get in a c switch. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 04:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-statement-with-in-and-bracket/m-p/7042309#M1500862</guid>
      <dc:creator>NigelJames180</dc:creator>
      <dc:date>2013-05-14T04:27:35Z</dc:date>
    </item>
  </channel>
</rss>

