ABAP Keyword Documentation → ABAP - Reference → Declarations → Declaration Statements → Data Types and Data Objects → Declaring Data Types → TYPES
TYPES - RANGE OF
Other versions: 7.31 | 7.40 | 7.54
Syntax
TYPES dtype {TYPE RANGE OF type}|{LIKE RANGE OF dobj}
[INITIAL SIZE n].
Effect
Derives a table type for a ranges table. A ranges table is a standard table with a standard key and a specially structured row type whose internal definition can be displayed as follows in ABAP syntax:
sign TYPE c LENGTH 1,
option TYPE c LENGTH 2,
low {TYPE type}|{LIKE dobj},
high {TYPE type}|{LIKE dobj},
END OF linetype.
The additions TYPE and LIKE determine the data type of the components low and high:
-
typecan be a non-generic data type from ABAP Dictionary, a non-generic public data type of a public data type or global class, a non-generic data type local to a program, or any ABAP type from the tables of predefined ABAP types. The generic ABAP typesc,n,p, andxare implicitly extended to the standard length without decimal places from the tables of predefined ABAP types. -
dobjcan be a data object visible at this point, whose type is used for both components. Generically typed formal parameters cannot be specified fordobjwithin a procedure.
The addition INITIAL SIZE is synonymous with the definition of normal internal table types.
Notes
-
A ranges table has the same structure as a
selection table, and can be used to pass values to the
selection screens of an
executable program called using
SUBMITin a comparison expression with the relational operatorINor in a similar expression in aWHEREcondition in Open SQL. -
The
signandoptioncolumns of a ranges table declared usingRANGE OFare not related to data types in ABAP Dictionary. For a ranges table defined in ABAP Dictionary, these columns are based on the data elements DDSIGN and DDOPTION.