‎2007 Feb 13 4:29 AM
Hi,
I am creating a report which has tables like bsik, bsak, bseg, bkpf, rbkp. vbrk, likp. The report is taking too long to execute.
Also, when i enter the selection parameters, the reports hangs. On the other hand the reports runs faster with no selection parameter entered.
Can anyone let me know what could be the problem be?
Thanks,
Amit.
‎2007 Feb 13 4:40 AM
Make sure that u have used the key fields in the query for retrieving data.
So that it will be faster.
Paste ur select query here.
‎2007 Feb 13 4:38 AM
Analyse the program and optimize the program
https://wiki.sdn.sap.com/wiki/display/HOME/ABAPPerformanceand+Tuning#ABAPPerformanceandTuning-WhatarethestepstooptimisetheABAPCode%3F
Please make your question more clear if you need a quick response.
Thanks
Wenceslaus
‎2007 Feb 13 4:40 AM
Make sure that u have used the key fields in the query for retrieving data.
So that it will be faster.
Paste ur select query here.
‎2007 Feb 13 5:11 AM
Hi,
I emailing my code below. Please let me know which part of the code can be improved.
Thanks,
Amit.
SELECT belnr gjahr bukrs lifnr ebeln ebelp vbeln FROM bseg
INTO TABLE i_bseg
FOR ALL ENTRIES IN i_bsik
WHERE bukrs EQ i_bsik-bukrs
AND belnr EQ i_bsik-belnr
AND gjahr EQ i_bsik-gjahr.
SELECT bukrs gjahr xblnr belnr FROM bkpf INTO TABLE i_bkpf
FOR ALL ENTRIES IN i_bseg
WHERE bukrs EQ i_bseg-bukrs
AND belnr EQ i_bseg-belnr
AND gjahr EQ i_bseg-gjahr.
ENDIF.
SELECT belnr waers bukrs FROM RBKP INTO TABLE i_rbkp
FOR ALL ENTRIES IN i_bkpf
WHERE gjahr EQ i_bkpf-gjahr
AND bukrs EQ i_bkpf-bukrs
AND xblnr EQ i_bkpf-xblnr.
‎2007 Feb 13 5:16 AM
hi,
1. chk the itab
i_bsikis initial or not before the select query.
2. Same in the case of
i_bsegand
i_bkpfOtherwise it looks ok.
eg:
if i_bsik[] is not initial.
SELECT belnr gjahr bukrs lifnr ebeln ebelp vbeln FROM bseg
INTO TABLE i_bseg
FOR ALL ENTRIES IN i_bsik
WHERE bukrs EQ i_bsik-bukrs
AND belnr EQ i_bsik-belnr
AND gjahr EQ i_bsik-gjahr.
endif.Regards
Anver
‎2007 Feb 13 5:26 AM
y u r using bseg . u r already fetch data for vendor from table bsik.check the functionality again of ur requirment.
‎2007 Feb 13 6:50 AM
hi amit
check the order of the fields in select statement,it should match with the order in the data dictionary.the oredr should be bukrs,belnr,gjahr....
check it...
‎2007 Feb 13 5:06 AM
hi,
chk this.
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abapPerformanceand+Tuning&
http://www.erpgenie.com/abap/performance.htm
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abapPerformanceand+Tuning&
http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f7c454211d189710000e8322d00/frameset.htm
Regards,
Anver
‎2007 Feb 14 10:55 AM
Hello Amit,
Please check the internal table whether it is initial or not. Because using internal table against FOR ALL ENTRIES with empty records will fetche all the records from the matching tables.
Regs,
Venkat Ramanan N