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

Improve Performance for this select

Former Member
0 Likes
916

Hi All,

I have a performance issue.

This below is my select statement. And it takes a long time to retrieve the data.

    
SORT i_mvke BY matnr.
SELECT kunnr werks matnr FROM msku INTO TABLE i_msku
     FOR ALL ENTRIES IN i_mvke                              
     WHERE matnr = i_mvke-matnr
       AND kunnr IN r_kunnr
       AND werks IN s_werks.

is there any way to improve this select.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
877

Hi,

if you don't need all 'Special stock indicator' make also a select about it. msku-SOBKZ

NL

Hi All,

I have a performance issue.

This below is my select statement. And it takes a long time to retrieve the data.

    
SORT i_mvke BY matnr.
SELECT kunnr werks matnr FROM msku INTO TABLE i_msku
     FOR ALL ENTRIES IN i_mvke                              
     WHERE matnr = i_mvke-matnr
       AND kunnr IN r_kunnr
       AND werks IN s_werks.

is there any way to improve this select.

Thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
878

Hi,

if you don't need all 'Special stock indicator' make also a select about it. msku-SOBKZ

NL

Read only

0 Likes
877

Thanks NL & Rich.

But its still sluggish after including SOBKZ. And i did have a check for MVKE not being empty.

How can i make use of index? How do i know if this table has any?

Thanks again.

Read only

0 Likes
877

SE11 --> msku --> Index Button.

In my system, no index is defined for this table...

How to use index??? Just include them in your where parameters...

Greetings,

Blag.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
877

Make sure that there are rows in I_MVKE.

if not i_mvke[] is initial.
SORT i_mvke BY matnr.
SELECT kunnr werks matnr FROM msku INTO TABLE i_msku
     FOR ALL ENTRIES IN i_mvke                              
     WHERE matnr = i_mvke-matnr
       AND kunnr IN r_kunnr
       AND werks IN s_werks.
endif.

Regards,

Rich Heilman

Read only

shishupalreddy
Active Contributor
0 Likes
877

Hi ,

Hi

For the follwing query You can create the secondary index on the field 'Special Stock Indicator' in SE11 and then use the same in <Where > clause.

if not i_mvke is initial.

SORT i_mvke BY matnr.

SELECT kunnr werks matnr FROM msku INTO TABLE i_msku

FOR ALL ENTRIES IN i_mvke

WHERE matnr = i_mvke-matnr

AND kunnr IN r_kunnr

AND werks IN s_werks.

Regards,

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
877

Hi,

Check whether your internal table i_msku contains only the fields kunnr werks and matnr.Otherwise use as following.

SORT i_mvke BY matnr.

SELECT kunnr werks matnr FROM msku INTO corresponding fields of TABLE i_msku

FOR ALL ENTRIES IN i_mvke

WHERE matnr = i_mvke-matnr

AND kunnr IN r_kunnr

AND werks IN s_werks.

still the performance is not improved,try using index.

otherwise select all the rows from msku at a strech and then delete the unwanted rows thereafer.

Kindly reward points if it helps.