2008 Oct 28 3:00 PM
Hi,
I need to check a value is there or not in a range. Can somebody tell me the logic please.
r_ranges is having company code ranges like...
I EQ 1001 1004
I EQ 2001 2006
I EQ 3001 3009
I EQ 4001 4007
Now I want to check a variable is there in the above range or not.
Can somebody tell me the logic.
<removed_by_moderator>
Cheers.
Edited by: Julius Bussche on Oct 28, 2008 4:15 PM
2008 Oct 28 3:10 PM
Before trying logic, correct the range. The option you should be using is 'BT', not 'EQ'.
Rob
Hi,
I need to check a value is there or not in a range. Can somebody tell me the logic please.
r_ranges is having company code ranges like...
I EQ 1001 1004
I EQ 2001 2006
I EQ 3001 3009
I EQ 4001 4007
Now I want to check a variable is there in the above range or not.
Can somebody tell me the logic.
<removed_by_moderator>
Cheers.
Edited by: Julius Bussche on Oct 28, 2008 4:15 PM
2008 Oct 28 3:02 PM
Check like:
IF W_BUKRS IN R_BUKRS.
WRITE: ' IT IS VALID'.
ELSE.
WRITE: 'NOT VALID'.
ENDIF.
Regards,
Naimesh Patel
2008 Oct 28 3:02 PM
Try:
IF v_ccode IN r_ranges.
"Company code exist in range.
ELSE.
"Company code does not exist.
ENDIF.
2008 Oct 28 3:03 PM
Hi,
Use something like
if v_variable in r_range.
endif.or
if not v_variable in r_range.
endif.Darren
2008 Oct 28 3:12 PM
When I use
if v_variable in r_range.
endif.
It is checking only lower limit of the range. Ex: if ranges contains I EQ 1001 1006. If I check the value 1003, If condition is failed.
What to do.
Regards,
2008 Oct 28 3:15 PM
Hi,
The filling up the range table is incorrect. When you have Low as well as High value means range.. you can't use 'EQ' as option instead use 'BT'.
Hope this helps.
Regds,
R
2008 Oct 28 3:16 PM
>
> It is checking only lower limit of the range. Ex: if ranges contains I EQ 1001 1006. If I check the value 1003, If condition is failed.
Check my answer above.
Rob
2008 Oct 28 3:10 PM
Before trying logic, correct the range. The option you should be using is 'BT', not 'EQ'.
Rob
2008 Oct 28 3:20 PM
Do what Rob suggested, do not use EQ, use BT. EQ = equal = single value. BT = Between = range.