3
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. ? 1 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. ? 1 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’

Defining Range Type in ABAP

Embed Size (px)

DESCRIPTION

Range

Citation preview

Defining Range Type in ABAPRange 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.?1DATA : 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.?1DATA : 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.