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

Sq02 Extra field

Former Member
0 Likes
884

HI ,

I have created a query and looking for multiple conditions.I have created coding where system checks for one condition but I want to check multiple conditions .

Single condition

check LFB1-bukrs ='A'
   AND PURCHASINGORG ='A1'.


I have couple of more condition to check here like


check LFB1-bukrs ='A'
   AND PURCHASINGORG ='A1'.

OR

check LFB1-bukrs ='B'
   AND PURCHASINGORG ='B1' or 'B2'


OR

check LFB1-bukrs ='C'
   AND PURCHASINGORG ='C1' .


Many Thanks

1 ACCEPTED SOLUTION
Read only

tomas_talpa
Active Contributor
0 Likes
843

Yyou pretty much posted your logic, Preeti, just wrap it in brackets (each AND statement and total OR statement) and you are done... or what is the question?

TomT

4 REPLIES 4
Read only

tomas_talpa
Active Contributor
0 Likes
844

Yyou pretty much posted your logic, Preeti, just wrap it in brackets (each AND statement and total OR statement) and you are done... or what is the question?

TomT

Read only

0 Likes
843

Hi tom .

Thank you ,

I tried in different ways but getting errors.

check LFB1-bukrs ='A'
  ( AND PURCHASINGORG ='A1'.)

OR

check LFB1-bukrs ='B'
   (AND PURCHASINGORG ='B1' or 'B2')

Read only

0 Likes
843

CHECK(

       ( LFB1-bukrs ='A' AND PURCHASINGORG ='A1') OR
       ( LFB1-bukrs ='B' AND PURCHASINGORG ='B1') OR

       ( LFB1-bukrs ='B' AND PURCHASINGORG ='B2') OR

       ( LFB1-bukrs ='C' AND PURCHASINGORG ='C1')    ) .


...bit overdone with brackets (since AND precedes OR in priority), but it makes it legible.

Read only

0 Likes
843

Thanks Tom.

It worked .