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

optimizing condition check

Former Member
0 Likes
531

Hi,

i have a check with several conditions in it including checking a range tab.it looks similar to this.

if ( a = '12345') OR ( a = '34567' ) OR ( a IN r_rangetab).

...

endif.

how to skip '( a IN r_rangetab )' check if my range table is inital.

your help is appreciated.

Thanks,

KP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
509

Like this

if ( a = '12345') OR ( a = '34567' ) OR ( r_rangetab[] IS NOT INITIAL AND

a IN r_rangetab).

4 REPLIES 4
Read only

Former Member
0 Likes
510

Like this

if ( a = '12345') OR ( a = '34567' ) OR ( r_rangetab[] IS NOT INITIAL AND

a IN r_rangetab).

Read only

JozsefSzikszai
Active Contributor
0 Likes
509

hi kumar,

if ( ( a = '12345') OR ( a = '34567' ) OR ( a IN r_rangetab) ) AND ( r_rangetab IS NOT INITIAL) ) OR

( ( a = '12345') OR ( a = '34567' ) ) AND ( r_rangetab IS INITIAL ).

hope this helps

ec

Read only

Former Member
0 Likes
509

Hi

When there is a Range table you can very well populate these single values

( a = '12345') OR ( a = '34567' )

also into that ranges tables

like

r_field-sign = 'EQ'.

r_field-option = 'I'.

r_field-low = '12345'.

append r_field.

then you can simply use

if not a in r_field.

.............

endif.

Regards

anji

Read only

Former Member
0 Likes
509

Hi,

Use the logic like this..

Add these two values too in ur rangetab.

r_rangetab-sign = 'I'.

r_rangetab-option = 'EQ'.

r_rangetab-low = '12345'.

APPEND r_rangetab.

Clear r_rangetab-low.

r_rangetab-low = '34567'.

APPEND r_rangetab.

Now ur condition will be :

IF NOT r_rangetab IS INITIAL.

AND a IN r_rangetab.

ENDIF.

Thanks and Best Regards,

Vikas Bittera.

**Points for useful answers**