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

Ranges

Former Member
0 Likes
470

Hi,

There is a select statement which is causing performance issue.

SELECT

matnr

charg

sobkz

kunnr

lfgja

lfmon

kulab

FROM msku

INTO TABLE t_msku

FOR ALL ENTRIES IN t_msku_key

WHERE

matnr IN s_matnr

AND werks IN r_werks

AND sobkz IN r_sobkz

AND kunnr = t_msku_key-kunnr

In this select statement matnr is not a mandatory field.Since this is a mandatory field in msku table and this is not passed in the where condition of the select statement it is taking lot of time for execution.

Is it possidle to use range on matnr field instead of select-option field?

If so how do we populate that range?which function module do we use for this?

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
446

> Is it possidle to use range on matnr field instead of select-option field?

Select-options is a range. If you leave it empty, your query will run for a long time on a large table, no matter what.

Since you have an EQ-condition on KUNNR, you might want to investigate if there is another table allowing quick access by that field (I'm not aware of one), or if that query is so important and used in several programs, then maybe create a new secondary index on MSKU-KUNNR.

Thomas

Read only

Former Member
0 Likes
446

Maybe you can also fill MATNR when creating t_msku_key. I don't know how you get that table?

Read only

Former Member
0 Likes
446

Try, Creating a secondary index on

werks

sobkz

kunnr

This might help in imporving the performance

Read only

rodrigo_paisante3
Active Contributor
0 Likes
446

Hi,

Tell to user that select-options of matnr need to be mandatory, you cant do much more if this important select options is empty.

Regards