Application Development 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: 

problem while using RANGES

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi ,

Can u paste the code so that i will be easy to give the solution..

with Regards,

Ranganathan.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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