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

select-options data

Former Member
0 Likes
637

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
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
616

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
Read only

Former Member
0 Likes
616

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
617

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

Read only

Former Member
0 Likes
616

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

Read only

Former Member
0 Likes
616

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.

Read only

Former Member
0 Likes
616

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.

Read only

Former Member
0 Likes
616

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.