For example, if you want to define a range of type MARA-MATNR then statement would be.
DATA : r_matnr TYPE RANGE OF mara-matnr .
To insert data in range table you will need compatible work area which can be defined using TYPE LINE OF clause.
DATA : ty_matnr TYPE LINE OF r_matnr.
You can use range to specify complex criteria in many statements in ABAP .i.e. IF, LOOP, CHECK, SELECT etc.
Range type can be defined centrally in data dictionary which can be very useful in case of passing values between program and function module or smartform.
Step 1 : Go to transaction SE11 and enter name of range in Data type input and hit create.
Step 2 : Select ‘Table Type’
Step 3 : Enter short text and select menu Edit->Define as range table type.
Step 4: Specify ‘Data Element’ as MATNR and enter name in ‘Structured Row Type’ then Save. After saving hit ‘Create’ button.
Step 5: Work are will be created automatically with data element MATNR. Enter short text, save and activate.