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: 

MKPF & MSEG Performance issue : Join on table MKPF & MSEG taking too much time ..

Former Member
0 Kudos

Hello Experts,

I had a issue where we are executing one custom report in which  i used inner join on table  MKPF & MSEG,  some time join statement  took  9-10 min to excute and some time execute within  1-2 min with same test data .

i am not able to understand what the actaully happing .

please help.

code :

   SELECT f~mblnr f~mjahr f~usnam f~bktxt  p~bukrs
    INTO TABLE itab
    FROM mkpf AS f INNER JOIN mseg AS p
        ON f~mblnr = p~mblnr AND f~mjahr = p~mjahr
     WHERE f~vgart = 'WE'
       AND f~budat IN p_budat
       AND f~usnam IN p_sgtxt
       AND p~bwart IN ('101','105')
       AND p~werks IN p_werks
       AND p~lgort IN p_lgort.

Regards,

Dipendra Panwar.

1 ACCEPTED SOLUTION

Former Member

Hi Dipen,

It is as Klaus said.... also it is better if you use the BUDAT as the first key and see that it is always filled that will help.

Regards

4 REPLIES 4

former_member195402
Active Contributor
0 Kudos

Hi Dipendra,

if you call a report twice after another with the same test data for data selection, then the second run should be faster, because some data are remaining in memory and needn't to be caught from database. This will be also for the following third und further runs, until the data in the SAP memory will be removed by other programs.

For performance traces you should try to test with a first run.

Regards,

Klaus

Former Member

Hi Dipen,

It is as Klaus said.... also it is better if you use the BUDAT as the first key and see that it is always filled that will help.

Regards

0 Kudos

There are tons of material already available on SCN on the performance analysis, you might want to take advantage of the search. I like this blog in particular.

Former Member
0 Kudos

This message was moderated.