‎2009 Aug 13 1:12 AM
Hi Folks,
I need 4 different conditions to be checked.
Bottom line :
1. all the conditions are true - No problem
2. all the conditions are false - No problem
3. each condition is true - No probem
4. How do i check more than 1 condition is true?
Regarding 4, I don't want to write 4 x 4 = 16 statements to check each possible cosdition is true or not.
Any simplified solution for this??
Let me know.
Thanks
Matt
‎2009 Aug 13 1:23 AM
‎2009 Aug 13 1:23 AM
‎2009 Aug 13 1:29 AM
Nope, more than one contdition is true.
T - True
F - False
FFTT
FTFT
FTTF
FTTT
TFFT
TFTF
TFTT
TTFF
TTFT
TTTF
I want to check the above conditions in single statement??
is there a easy way??? if not in single statement even fewer statement will be better
Any thoughts??
Thanks,
Matt
‎2009 Aug 13 1:34 AM
I don't think you can write a single statement for that.
The simplest thing you can do is:
if condition1 = true.
count = count +1.
if condition2 = true.
count = count +1.
if condition3 = true.
count = count +1.
if condition4 = true.
count = count +1.
if count > 1.
THE CONDITION satisfied.
‎2009 Aug 13 1:29 AM
Try like this
data : v_all_true type I .
if condition 1 = condition 2.
else.
v_all_true = v_all_true + 1
endif.
if condition 1 = condition 3.
else.
v_all_true = v_all_true + 1
endif.
...
...
if v_all_true eq 0
" all conditions passed
else.
" all conditions failed
endif
Make of FLAG logic to other condition scenarios also
a®
‎2009 Aug 13 1:33 AM
There is a problem. I didn't explain clearly. mistake is mine.
val1 = A or ' '
val2 = B or ' '
val3 = C or ' '
val4 = D or ' '
I want to check when more than one value of val1, val2, val3 , val4 is not initial. (not each/single value)
That's the problem.
‎2009 Aug 13 1:44 AM
> val1 = A or ' '
> val2 = B or ' '
> val3 = C or ' '
> val4 = D or ' '
> I want to check when more than one value of val1, val2, val3 , val4 is not initial. (not each/single value)
>
I am confused !!!
1. do you have only four variables val1, val2, val3, val4
or
2. or these are in table records ?
Please give your reply with what is your input and what output do you want ?
a®