Professional Documents
Culture Documents
Defining Range Type in ABAP
Defining Range Type in ABAP
Range is internal table of structure which has four component in it namely SIGN, OPTION, LOW and HIGH. The data type of LOW and HIGH is specified while creating the range. For example, if you want to define a range of type MARA-MATNR then statement would be.
DATA :
To insert data in range table you will need compatible work area which can be defined using TYPE LINE OF clause.
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 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.