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

Help on select options.

Former Member
0 Likes
690

Hi gurus!!

I have a report where in i am putting the values in select-options. but yj eproblem i have is when i am not putting any values i am getting the correct output.

but with the same data i am putting the values in low or high i am not getting any data..

so i think i need to put all the entrioes of the select option in an internal table or ranges i dont know and then we give some code like

ranges : ra_stotal for ztsd120-zlow.

ra_stotal-sign = 'I'.

ra_stotal-option = 'BT'.

ra_stotal-low = zlow-low.

ra_stotal-high = zlow-high.

append ra_stotal.

clear ra_stotal.

Can anyone tell me if this is what i got to do if so how?

or is there some other way out?

7 REPLIES 7
Read only

Former Member
0 Likes
673

Hi,

Using Range is the absolute method which u r using u can go for select options directly why do u want to go wit the range method....Select options will inernally create this structure so u will not be facing with the issues...

Regards,

Sana.

Read only

Former Member
0 Likes
673

hi,

SELECT-OPTIONS :ra_stotal for ztsd120-zlow,

use this.. it will solve your problem..

thnx,

reward if useful

Read only

former_member386202
Active Contributor
0 Likes
673

Hi,

Try like this

ranges : ra_stotal for ztsd120-zlow.

INITIALIZATION.

ra_stotal-sign = 'I'.

ra_stotal-option = 'BT'.

ra_stotal-low = zlow-low.

ra_stotal-high = zlow-high.

append ra_stotal.

clear ra_stotal.

START OF SELECTION.

select f1 f2 from table itno itab

where stotal in ra_stotal.

Regards,

pRashant

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
673

Hi,

As suggested select-options will take care whether you are giving values in high or low.

If you are giving values in low, then it will take the specific value only.

If you are giving values in high, it wil take o for low and the value for high.So internally program will fetch the data for the range 0 to the value specified in high.

Read only

Former Member
0 Likes
673

Hi,

There is no need for any range as Select Option it self behaves as a Range.

Just make sure that while getting the data from the table in where clause you are saying

Select....

,......

where zlow in so_zlow.

This should fix ur problem.

Please revert back if still there are issues.

regards,

Lalit

Read only

former_member282823
Active Participant
0 Likes
673

Hi,

We need not use any ranges for that...only select-options is enough. You can directly use the query and in condition use IN operator.

Eg. select * from table into It_tab where condition in s_xxx.

This is fetch you the required data.

Regards,

Ramesh.

Read only

Former Member
0 Likes
673

Hi Mona,

Please check the below code in BOLD letter....

I guess you are having a problem in SELECT-OPTIONS because ...might be u r using EQ in where condition of your select query. Whenever u r using SELECT-OPTIONS, it should be "IN" in the where condition.

Eg:- SELECT <field names>

FROM MARA

INTO TABLE <it_tablename>

WHERE matnr IN s_matnr.

Reward points for helpful answers.

Regards,

HK.