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: 

Using Ranges in the program.

Former Member
0 Kudos

Hi,

When i use the range in my program it gives the follwing error

the range i declare is r_matnr.

the in operator with r_matnr is followed neither by an internal table nor by a value list.

2 REPLIES 2

Former Member
0 Kudos

Hi,

I assume that you have not had a problem declaring the RANGES.

Now you should know that r_matnr is actually an internal table (exactly similar to the selection-table you'd have obtained , had you declared a select-options for MATNR). Treat it like an internal table. If you use it as a normal field, you are bound to end up in errors like that.

Regards,

Anand Mandalika.

Former Member
0 Kudos

Hi,

The declaration shoul be something like:

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.

Note 1: MATNR is CHAR(18) - so be sure to start with leading zeroes, if applicable.

Note 2: Dont forget the APPEND.

Hope this helps (please reward me if it does),

Joerg