Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

multiple condition in the select statement

Former Member
0 Likes
1,295

Dear gurus,

Can i use the following syntax for getting data from an internal table.

IF ( WS_CHANNEL = '10' OR WS_CHANNEL = '11' OR WS_CHANNEL = 12 or ws_channel = 15 or ws_channel = 40 ) or ( ( WS_CHANNEL = '50' OR WS_CHANNEL = '60' ) and

( itab-loc = '4058')).

if it is not the correct syntax , how to do it.

Please do the need ful.

Thanx in advance.

R.Rajendran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,182

Hi Rajender,

Yes, Offcourse this can be possible the only thing in this multiple condition.you need to put a proper open '(' and Closed ')' bracket.

Rest all looks ok to me....

&******Reward point if helpful*************&

8 REPLIES 8
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,182

hi,

yes it is OK. However you can make it a bit simplier:

IF ( ( WS_CHANNEL IN ( '10' , '11' , '12' , '15' , '40' )

OR ( WS_CHANNEL IN ('50', '60' ) AND

itab-loc = '4058' ) ) .

hope this helps

ec

Read only

0 Likes
1,182

Please provide proper open bracket and close bracket. since given syntax not working properly.

Read only

Former Member
0 Likes
1,183

Hi Rajender,

Yes, Offcourse this can be possible the only thing in this multiple condition.you need to put a proper open '(' and Closed ')' bracket.

Rest all looks ok to me....

&******Reward point if helpful*************&

Read only

Former Member
0 Likes
1,182

Your syntax is correct. But its better to modify it to

IF ( ( WS_CHANNEL IN ( '10' , '11' , '12' , '15' , '40' )

OR ( WS_CHANNEL IN ('50', '60' ) AND

itab-loc = '4058' ) )

Read only

Former Member
0 Likes
1,182

hiii

you can use it like following code

IF ( WS_CHANNEL IN ( '10' , '11' , '12' , '15' , '40' ) 
OR ( WS_CHANNEL IN ('50', '60' ) AND
itab-loc = '4058' ) ) .

reward if useful

thx

twinkal

Read only

0 Likes
1,182

IF( WS_CHANNEL IN ( '10','11') or ( ws_channel in ('50','60') and itab-loc = '4058')).

  • IF WS_CHANNEL = '10' OR WS_CHANNEL = '11' OR WS_CHANNEL = 12 or ws_channel = 15 or ws_channel = 40.

i have given the above statement but the following error shows.

comma without preceeding colon ( after IF (?).

please do the needful.

Regards

R.Rajendran

Read only

Former Member
0 Likes
1,182
it is ok

Amit.

Read only

Former Member
0 Likes
1,182

check any other errors with the previous statement.