Application Development and Automation 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: 
Read only

Compare select option with a range

michael_teran
Participant
0 Likes
2,895

I have a range of lgart, with values like 9000 bt 8000.

The selection screen have a selecto option for lgart.

I want to have all the lgart entered by the users and that belows to the range.

How can I do that??????????

1 ACCEPTED SOLUTION
Read only

michael_teran
Participant
0 Likes
1,528

this is the scenary.

I have a range (lgart)

RANGES: gr_lgart FOR t512t-lgart,

with the values low = 9000 sign = bt high = 9500.

At the selection screen

SELECT-OPTIONS : S_lgart for t512t-lgart .

At the selection screen the user can enter the value

S_lgart-low eq 9870 sign eq

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

...

I want to get all the values from the select option that belongs to my range gr_lgart.

How can I compare ... for example in this case i will use just

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

Because is the only range that belongs to my range

this is the scenary.

I have a range (lgart)

RANGES: gr_lgart FOR t512t-lgart,

with the values low = 9000 sign = bt high = 9500.

At the selection screen

SELECT-OPTIONS : S_lgart for t512t-lgart .

At the selection screen the user can enter the value

S_lgart-low eq 9870 sign eq

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

...

I want to get all the values from the select option that belongs to my range gr_lgart.

How can I compare ... for example in this case i will use just

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

Because is the only range that belongs to my range

6 REPLIES 6
Read only

Former Member
0 Likes
1,528

Hi

I don't understand which kind of control u need to do, anyway the SELECT-OPTIONS and RANGE are two internal table with the same structure so:

APPEND LINES OF T_RANGE TO S_SEL_OPT.

If RANGE means interval for you with a min and a max value:

S_SEL_OPT(3) = 'IBT'.

S_SEL_OPT-LOW = <min>.

S_SEL_OPT-HIGH = <max>.

APPEND S_SEL_OPT.

Max

Read only

Former Member
0 Likes
1,528

Hello

Since select options and ranges are both internal tables with the same structure you can use a range the same as you use a select option in your database select statement.

 Select * from your_table
    into your itab
    where lgart in so_lgart  or
          lgart in r_lgart.    " your range table.  

Regards

Greg Kern

Read only

Former Member
0 Likes
1,528

>

> I want to have all the lgart entered by the users and that belows to the range.

Do you really mean AND? Or do you want OR?

Rob

Read only

michael_teran
Participant
0 Likes
1,529

this is the scenary.

I have a range (lgart)

RANGES: gr_lgart FOR t512t-lgart,

with the values low = 9000 sign = bt high = 9500.

At the selection screen

SELECT-OPTIONS : S_lgart for t512t-lgart .

At the selection screen the user can enter the value

S_lgart-low eq 9870 sign eq

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

...

I want to get all the values from the select option that belongs to my range gr_lgart.

How can I compare ... for example in this case i will use just

S_lgart-low eq 9100 sign bt S_lgart-high eq 9200.

Because is the only range that belongs to my range

Read only

0 Likes
1,528

It looks to me that you would follow Greg's advice, but use 'AND' instead of 'OR'.

Rob

Read only

0 Likes
1,528

Hi

RANGES: gr_lgart FOR t512t-lgart.

SELECT-OPTIONS : S_lgart for t512t-lgart .

START-OF-SELECTION.

   SELECT * FROM <TABLE> INTO ITAB WHERE LGART IN S_LGART.
     
       IF ITAB-LGART IN GR_LAGRT.
          APPEND ITAB.
      ENDIF.

 ENDSELECT.

U can also upload all hit in ITAB and the delete the record not in your range.

RANGES: gr_lgart FOR t512t-lgart.

SELECT-OPTIONS : S_lgart for t512t-lgart .

START-OF-SELECTION.

   SELECT * FROM <TABLE> INTO TABLE ITAB WHERE LGART IN S_LGART.
     
  DELETE ITAB WHERE NOT LGART IN GR_LAGRT.

Max