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

Question reg. range

Former Member
0 Likes
516

Hi,

I am attaching my sample code below. itab_var, r_var1 and r_var2 are all of bsis-hkont type. Even though itab_var has value '0000121000' and not in the ranges r_var1 and r_var2 and not equal to '0000720000', it is still succeeding the IF condition and going inside when I see in debugging mode. How is it possible? Can you please tell me where is the error?

Thank you very much.

RANGES: r_var1 FOR bsis-hkont,

r_var2 FOR bsis-hkont.

itab_var = '0000121000'.

r_var1-sign = 'I'.

r_var1-option = 'BT'.

r_var1-low = '0000700000'.

r_var1-high = '0000719999'.

r_var2-sign = 'I'.

r_var2-option = 'BT'.

r_var2-low = '0000740000'.

r_var2-high = '0000749999'.

IF itab_var IN r_var1

OR itab_var IN r_var2

OR itab_var EQ '0000720000' .

-


-


-


ENDIF.

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
487

Hi,

You are missing append statement.

RANGES: r_var1 FOR bsis-hkont,

r_var2 FOR bsis-hkont.

itab_var = '0000121000'.

r_var1-sign = 'I'.

r_var1-option = 'BT'.

r_var1-low = '0000700000'.

r_var1-high = '0000719999'.

<b>append r_var1.</b>

r_var2-sign = 'I'.

r_var2-option = 'BT'.

r_var2-low = '0000740000'.

r_var2-high = '0000749999'.

<b>append r_var2.</b>

IF itab_var IN r_var1

OR itab_var IN r_var2

OR itab_var EQ '0000720000' .

-


-


-


ENDIF.

Regards,

Ferry Lianto

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
488

Hi,

You are missing append statement.

RANGES: r_var1 FOR bsis-hkont,

r_var2 FOR bsis-hkont.

itab_var = '0000121000'.

r_var1-sign = 'I'.

r_var1-option = 'BT'.

r_var1-low = '0000700000'.

r_var1-high = '0000719999'.

<b>append r_var1.</b>

r_var2-sign = 'I'.

r_var2-option = 'BT'.

r_var2-low = '0000740000'.

r_var2-high = '0000749999'.

<b>append r_var2.</b>

IF itab_var IN r_var1

OR itab_var IN r_var2

OR itab_var EQ '0000720000' .

-


-


-


ENDIF.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
487

Don't you need to append to r_var1 and r_var2?

Read only

0 Likes
487

Thanks Ferry and Matt!!!