2008 Aug 08 6:24 AM
Hi,
I have performance problen following code.It take more than 25 min to retrive data.Can help me to resolve it.
SELECT refbn rfbos rftyp gjahr wrttp stats twear yyaufnr hkont
lifnr SUM ( trbtr ) SUM ( fkbtr )
FROM fmioi INTO TABLE gt_fmioi
WHERE rldnr = gc_rldnr and
gjahr = pa_fyear and
fistl IN so_fctr and
fonds IN so_fund and
fipex IN so_comm and
fares = ' ' and
measure IN so_fprog and
wrttp IN (gc_wrttp_51,gc_wrttp_65) and
stats = gc_ststs and
fikrs = pa_area
GROUP BY refbn rfpos rftyp gjahr farea wrttp
stats twear yyaufnr hkont fikrs lifnr.
*I have maintain INDEX for follwing fields.*
rldnr = gc_rldnr value = '9A'
gjahr = pa_fyear value = 2007
fistl IN so_fctr and
fonds IN so_fund and
fipex IN so_comm and
fares = ' ' and
measure IN so_fprog and
wrttp IN (gc_wrttp_51,gc_wrttp_65) value = 51,65
stats = gc_ststs and
fikrs = pa_area value = 1000
Same thing happen for following code it take more than 25 min.
SELECT trbtr fkbtr wrttp hkont vogjahr voblnr kngjahr knbelnr knbuzei vrefbn vrfpo vrftyp FROM fmifiit
INTO TABLE gt_fmifiit
WHERE fikrs = '1000' and
rldnr = gc_rldnr and
gjahr = pa_fyear and
fistl IN so_fctr and
fonds IN so_fund and
fipex IN so_comm and
fares = ' ' and
measure IN so_fprog and
wrttp IN (gc_wrttp_54,gc_wrttp_61,gc_wrttp_66,gc_wrttp_57) and stats = gc_ststs and
I have maintain index which i have specified in where condition.
can u help to reduce the time.
Thanks,
Deesanth.
2008 Aug 11 5:52 PM
Hello Deeshanth,
Could you please have a look into the following SAP Notes, see if it is applicable or not.
542484
859991
678397
1173259
396878
330101
515201
953893
Also as rob mentioned could be problem with the internal tables, where data is not populating and could be problem with the statistics of the table fmioi. So please check the statistics of this table and if needed update the statistics. You can also verify the selectivity of the fields of this table through DB05.Please send us the details of DB05 ouput of each fields of this table so that we can check it out.
Yours Sincerely
Dileep
2008 Aug 08 7:12 AM
hi,
use ST05 to find if the select is using the Index u expected. See the Explain function to get more information of the select.
Also check if the select-options that u r passing to the Select are not initial.
regards,
madhu
2008 Aug 08 2:23 PM
I've done these SELECTs many times without problem. Your problem is likely either that one or more of so_fctr, so_fund or so_comm is empty or that your database statistics are not up to date.
Rob
2008 Aug 09 8:12 AM
hi,
any summarization do with internal table. But dont do with select statement. Performance will increase.
regards
raghu
2008 Aug 11 5:52 PM
Hello Deeshanth,
Could you please have a look into the following SAP Notes, see if it is applicable or not.
542484
859991
678397
1173259
396878
330101
515201
953893
Also as rob mentioned could be problem with the internal tables, where data is not populating and could be problem with the statistics of the table fmioi. So please check the statistics of this table and if needed update the statistics. You can also verify the selectivity of the fields of this table through DB05.Please send us the details of DB05 ouput of each fields of this table so that we can check it out.
Yours Sincerely
Dileep