10-21-2005 5:24 AM
Hi experts?
Is it possible to use RANGES in select statement directly??While iam using getting follwing error...
"The IN operator with "Range1" is followed neither by an internal table nor by a value list."
where might be the error?
Kaki
10-21-2005 5:29 AM
Kaki,
Are you sure you have declared it using the RANGES keyword?
If you have used PARAMETERS and then using the IN clause, usually the error comes.
Regards,
Ravi
10-21-2005 5:29 AM
Hi ,
Can u paste the code so that i will be easy to give the solution..
with Regards,
Ranganathan.
10-21-2005 5:38 AM
hi,
check you code whether you define the range correctly
Ranges : range1 for mara-matnr.
select ......from mara into table itab where matnr in range1.
cheers,
sasi
10-21-2005 5:45 AM
Hi,
This is how u use Ranges and Select.
RANGES:
r_matnr for mara-matnr.
Filling the range is accomplished by:
r_matnr-low = '000000000000000001'.
r_matnr-low = '000000000000009999'.
r_matnr-option = 'BT'.
r_matnr-sign = 'I'.
APPEND r_matnr.
The selection is then accomplished by:
SELECT * FROM mara WHERE matnt in r_matnr.
If you can paste ur code here, we can understand the requirement better.
Regards,
Anjali
10-21-2005 6:18 AM
Hi,
There is a change in syntax for Ranges from 4.7 onwards.
The correct sysntax to use the ranges is:
Correct syntax:
DATA rangetab TYPE|LIKE RANGE OF ...
Cause:
Tables with a header are not allowed in ABAP Objects; declare your table using permitted statements instead.
10-21-2005 7:40 AM
Hi,
check with my code.
select-options: r_matnr for mara-matnr no intervals.
at selection-screen.
check: not sy-ucomm = '%001'.
LOOP AT r_matnr.
IF r_matnr-SIGN NE 'I' OR r_matnr-OPTION NE 'EQ'.
message e000 with text-e02.
ENDIF.
ENDLOOP.
loop at r_matnr.
select...............where matnr = r_matnr-low.
endloop.
here with code you can give single values or you can give multiple values in selection screen.
i hope this will help you.
Cheers
Message was edited by: Deepak333 k