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: 

Is Ranges obsolete ?

Former Member
0 Kudos

Hi All,

Is . .

RANGES rangetab FOR f. obsolete, and i suppose to declare range tables like below ?

DATA rangetab TYPE RANGE OF MATNR.

thanks and regards

Deepti

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Deepti,

<b>Yes,You are absolutely correct.</b>

<b>1)</b>RANGES rangetab FOR f is an obsolette statement

<b>2)</b>The Object Oriented ABAP only supports TYPE RANGE OF.

DATA rangetab TYPE RANGE OF MATNR.

If you are working with OO ABAP then use TYPE RANGE OF only,Otherwise this will be displayed as ERROR in EPC check.

Thanks,

Vinay

4 REPLIES 4

Former Member
0 Kudos

Hai,

Ranges is not obsolete.

You can declare ranges as follows

RANGES rangetab for matnr.

It will have the internal table similar to selct-options.

Regards,

Umasankar

Former Member
0 Kudos

Yes deepti you are right ranges are now obsolete.When you go to extended check for your program you will find this error.

Now this format is used

DATA rangetab TYPE RANGE OF MATNR.

for creating ranges

Former Member
0 Kudos

Hi Deepti,

<b>Yes,You are absolutely correct.</b>

<b>1)</b>RANGES rangetab FOR f is an obsolette statement

<b>2)</b>The Object Oriented ABAP only supports TYPE RANGE OF.

DATA rangetab TYPE RANGE OF MATNR.

If you are working with OO ABAP then use TYPE RANGE OF only,Otherwise this will be displayed as ERROR in EPC check.

Thanks,

Vinay

Former Member
0 Kudos

Hi Deepti,

"RANGES rangetab FOR f" is obsolete. Please read the keyword help in ABAP editor.

<b>Cannot Use RANGES</b>

This statement creates a special table with a header and as such is not allowed in ABAP Objects.

In ABAP Objects, the following statement causes an error message:

RANGES rangetab FOR f.

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.

Hope this may help u in some way.