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

Performance issue

Former Member
0 Likes
561

Hi Gurus,

Can anyone tell me what needs to be done to improve performance of the below select statement.

If I give a range of plants it taking 4 mins to get 10344 records.

SELECT a~mblnr

a~budat

a~mjahr

b~ebeln

b~ebelp

b~matnr

INTO CORRESPONDING FIELDS OF TABLE li_temp_tab

FROM mkpf AS a INNER JOIN mseg AS b

ON amblnr = bmblnr

AND amjahr = bmjahr

WHERE a~budat IN s_budat

AND a~mjahr EQ p_mjahr

AND b~werks IN s_werks

AND b~prctr IN s_prctr

AND b~lifnr IN s_lifnr

AND b~bwart IN (gc_bwart,gc_bwart1,gc_bwart2)

AND b~matnr IN s_matnr.

Please let me know how I can improve the performance of this select statement.

Regards

Mac

1 ACCEPTED SOLUTION
Read only

b_deterd2
Active Contributor
0 Likes
544

Hi,

Check the indexes of MKPF and make sure you follow one of the indexes.

Run a performance trace with ST05 to see if additional performance improvements can be made.

regards,

bert

5 REPLIES 5
Read only

Former Member
0 Likes
544

hi,

1. Remove Joins and select the data into two different internal tables using two select statements and finally move the data into final internal table.

2. Avoid using into corresponding entries statements and use into table statement.

Regards,

Santosh

Read only

b_deterd2
Active Contributor
0 Likes
545

Hi,

Check the indexes of MKPF and make sure you follow one of the indexes.

Run a performance trace with ST05 to see if additional performance improvements can be made.

regards,

bert

Read only

Former Member
0 Likes
544

Hi,

You can create a Database view with this two tables MKPF and MSEG and then select data from this view.

Regards,

Fernando

Read only

Former Member
0 Likes
544

hi check this...

1 .use all the keys(primary and secondary) for best performance

2.use the for all entries rather than the joins

use these conditions and check the performance in the st05.

regards,

venkat.

Read only

Former Member
0 Likes
544

Is select option s_budat filled ? If not make sure you derive it from p_mjahr. MKPF has a secondary index on budat