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: 

select-options data

Former Member
0 Kudos
115

Hello

I have select options for material and plant (s_matnr and s_plant), and this select statement:

select *

from marc

where matnr IN s_matnr AND

werks IN s_plant.

To improve performance, I would like to obtain before all combinations material-plant, and to reduce the where clause into '=' comparisons.

Any help?

Thanks.

1 ACCEPTED SOLUTION

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
94

Hi,

When you use IN it will be converted to simple = and OR statements only.

Why do you want to do the job of the Database optimizer.

Regards,

Sesh

6 REPLIES 6

Former Member
0 Kudos
94

hi,

You can use parameter inplace of select-options and then use it like this

parameter : s_matnr like mara-matnr,

s_plant like mara-werks.

select *

from marc

where matnr = s_matnr AND

werks = s_plant.

Regards,

Himanshu

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
95

Hi,

When you use IN it will be converted to simple = and OR statements only.

Why do you want to do the job of the Database optimizer.

Regards,

Sesh

Former Member
0 Kudos
94

Hi Alberto,

By this way there will be no performance improvement.

If you don't want the use to enter the multipel entries then use PARAMETERS.

or you can try with SELECT OPTIONS with NO- INTERVAL option.

Regards,

Atish

Former Member
0 Kudos
94

hi,

selection-screen : begin of block blk1 with frame title text-001.

parameters : p_matnr like marc-matnr,

p_werks like marc-werks.

selection-screen : end of block blk1.

select * from marc where matnr = p_matnr

and werks = p_werks.

Reward with points if helpful.

Former Member
0 Kudos
94

Hi,

Is these values mandatory in selection screen? if not make it mandatory.

Otherwise if you pass an empty select option in your where clause, it is going to fetch all the data.

If you want to use single values use parameter otherwise ensure that S_matnr and s_werks are not empty.

Former Member
0 Kudos
94

you can use select-options: p_matnr for itab-matnr no-interval.

or

at selction-screen output.

loop at screen.

screen-name = 'p_matnr-high' .

screen-input = 0.

modify screen.

endloop.