DEFINING RANGES(select-options)

SELECT-OPTIONS

PARAMETERS  accept single value input fields. So for more complex selection, like range selection ABAP has a keyword SELECT-OPTIONS. You can link selection criteria to the columns of database tables and to internal fields in a program.

Syntax:

data : empno(10) type c.

select-options: s_empno for empno .

write : s_empno-low , s_empno-high.


This defines an internal table s_empno with fields s_empno-SIGN , s_empno-OPTION ,s_empno-LOW, s_empno-HIGH.


SIGN: The data type of SIGN is C with length 1. The content of SIGN determine for each row whether the row condition is to be inclluded or excluded. Possible value are 'I' or 'E'.

I = Inclusive and E = Exclusive

OPTION:  Explained with an example 

type c length 2.

The data type of OPTION is C with length 2. OPTION contains the selection operator. The following operators are available:
  •  If HIGH is empty, you can use EQ, NE, GT, LE, LT,CP, and NP. These operators are the same as those that are used for logical expressions.

  • If HIGH is filled, you can use BT (BeTween) and NB (Not Between). 

LOW : lower limit for range.

HIGH: Higher limit for range.

No comments:

Post a Comment