Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

please tell me the use of ranges , when it should be used

Former Member
0 Kudos

please tell me the use of ranges , when it should be used.

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Anytime you have to equate to multiple values in your programs. Say for example, you need to get data for two company codes from a table.

data: it001 type table of t001.
ranges: r_bukrs for t001-bukrs.

r_bukrs-sign = 'I'.
r_bukrs-option = 'EQ'.
r_bukrs-low = '0010'.
append r_bukrs.

r_bukrs-sign = 'I'.
r_bukrs-option = 'EQ'.
r_bukrs-low = '0020'.
append r_bukrs.

select * into table it001 from t001 where bukrs in r_bukrs.

Regards,

Rich Heilman

ferry_lianto
Active Contributor
0 Kudos

Hi,

It is used to group a range of values into an internal table similar to the selection table when we decalre select-options on the selection screen. The selection table consist of the field SIGN, OPTION, LOW and HIGH fields.

You use the IN operator in conjunction with SUBMIT, CHECK, IF, WHILE or SELECT statements.

Regards,

Ferry Lianto