04-23-2014 5:20 AM
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.
04-23-2014 5:47 AM
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
04-23-2014 5:35 AM
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
04-23-2014 5:47 AM
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
04-24-2014 10:20 PM
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.
04-24-2014 6:37 AM