cancel
Showing results for 
Search instead for 
Did you mean: 

Rnages

Former Member
0 Kudos

what is the purpose of ranges?

Regards,

pandu.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Rao,

RANGES are like an internal table with 4 fileds LOW, HIGH, SIGN and OPTION.

we could do manuplulations on it also.

Thanks,

Sunil

Former Member
0 Kudos

hi

good

The RANGES allow to specify a series of ranks of values to be used in the selection sentences, work of way similar to clause SELECT-OPTIONS that we used in programs ABAP, in fact this clause which does is to use ranks. When we executed the clause:

SELECT * FROM mara WHERE matnr IN mirango

the database engine that this sentence PL/SQL interprets will read the table MARA and recovered all those registries whose field MATNR this including/understanding within the rank of values specified “mirango”. So that this works we must have defined the content of “mirango” so that ABAP can make the search wished within the rank of values that interests to us to recover, for example: if we wished to recover from MARA all the materials whose numbers of material (MATNR) this including/understanding between 2 and 3 we must define a rank whose low or initial value (LOW) is 2 and whose high or final value (HIGH) is 3. In order to understand this with but clarity the following code of example is seen:

ystem: SAP R/3 * Name: Example of RANGES use. * I modulate: Basis * Author: Exequiel Lopez. * Date: 4/05/2006. * -


REPORT zexe001. * -


TABLES: mara. * -


RANGES: mirango FOR mara-matnr. * -


mirango-sign = “I”. mirango-option = “BT”. mirango-low = “000000000000000001”. mirango-high = “000000000000000003”. APPEND mirango. * -


SELECT * FROM mara WHERE matnr IN mirango. WRITE: /mara-matnr. ENDSELECT. * -


reward point if helpful.

thanks

mrutyun^

Former Member
0 Kudos

Hi

Ranges are used to add multiple values to a field

when declared it creates an internal table similar to select-options with the fields SIGN,OPTION,HIGH and LOW

see the doc

RANGES rtab FOR dobj [OCCURS n].

Obsolete declaration of a Ranges-table. This statement (not allowed in classes) is a short form of the following statement sequence:

DATA: BEGIN OF rtab OCCURS {10|n},

sign(1) TYPE c,

option(2) TYPE c,

low LIKE dobj,

high LIKE dobj,

END OF sel.

An internal table rtab with the structure of a selection table and a header line is declared. Without the addition OCCURS, the initial memory requirement (see DATA - ranges-tables) of the ranges-table is set to ten rows. With the addition OCCURS, you can specify a numeric literal or a numeric constant n to determine a different initial memory requirement.

It is not allowed to declare internal tables with header lines. Due to this, the statement RANGES is not allowed in header lines. To declare a ranges-table in classes, you can use the addition TYPE|LIKE RANGE OF (see TYPES - ranges-table type and DATA - ranges-tables).

Regards

Anji

Former Member
0 Kudos

Hi pandu,

Just do F1 on RANGES and you will get the detailed info.

Regards,

Atish