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

condition in smartform

soumya_jose3
Active Contributor
0 Likes
1,098

Hi,

I need to put a condition in smartform like below:

(IT_TAB-GRADE = '26' OR IT_TAB-GRADE = '27') AND IT_TAB-NO_INDC = 'X'.

In the codition tab I have written like this:

IT_TAB-GRADE = '26'

OR

IT_TAB-GRADE = '27'

IT_TAB-NO_INDC = 'X'.

But this condition is not working.

Appreciate any help.

Thanks & Regards,

Soumya.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
962

you need to pass like this:

IT_TAB-GRADE = '26'
IT_TAB-NO_INDC = 'X'. " this needs to be repeated
OR
IT_TAB-GRADE = '27'
IT_TAB-NO_INDC = 'X'.

3 REPLIES 3
Read only

Former Member
0 Likes
963

you need to pass like this:

IT_TAB-GRADE = '26'
IT_TAB-NO_INDC = 'X'. " this needs to be repeated
OR
IT_TAB-GRADE = '27'
IT_TAB-NO_INDC = 'X'.

Read only

matteo_montalto
Contributor
0 Likes
962

Hello Jose,

Unfortunately, there's no trivial way to express directly a logical "complex" disjunction (e.g. disjunction between conjunctions) in that condition tab for a smartform as no parenthesis are allowed; therefore there's no way to force the priority by which logical operators are evaluated.

You could easily workaround by expanding the clause

(IT_TAB-GRADE = '26' OR IT_TAB-GRADE = '27') AND IT_TAB-NO_INDC = 'X'.

in:

(IT_TAB-GRADE = '26' AND IT_TAB-NO_INDC = 'X') OR (IT_TAB-GRADE = '27' AND IT_TAB-NO_INDC = 'X').

This can be easily expressed in the condition tab as follows:

IT_TAB-GRADE = '26'

IT_TAB-NO_INDC = 'X'.

OR

IT_TAB-GRADE = '27'

IT_TAB-NO_INDC = 'X'.

Hope this helps

Matteo

Read only

Former Member
0 Likes
962

Hi,

Its better if you add a program lines above the condition and update a flag using IF statement for the above condition.

IF (IT_TAB-GRADE = '26' OR IT_TAB-GRADE = '27') AND IT_TAB-NO_INDC = 'X'.
l_flag = 'X'.
ENDIF.

After that in the condition just give the flag.

Regards

Karthik D