‎2007 Jul 11 1:22 PM
Hi Experts,
I have a report performance problem while fetching BELNR from BSEG table.
I have to print latest BELNR from BSEG where BUZID = M but at the time of execution of report, It is taking too much time (More that hour and sometimes it gets hanged).
I have also gone through the comments provided by experts for previous problems asked in this forum e.g. BSEG is a cluster table that is why data retrieval takes long time etc.
Can any one has any other idea or suggestion or any other way to solve this problem
Regards,
Neeraj
‎2007 Jul 11 1:28 PM
Hi,
Try using the keys(BUKRS,BELNR,GJAHR,BUZEI) of the table BSEG in the where condition.
Generally the performance does improve if you utilize as many keys as possible in the where condition while selecting from a database table.
Thanks,
Sandeep.
‎2007 Jul 11 1:26 PM
Hi neeraj,
1. One thing which can be done is to create a secondary index on BUZID field.
2. Also i assume that the select query is a simple one without any join.
regards,
amit m.
‎2007 Jul 11 1:26 PM
Hi,
BSEG is basically clusture table.
Use relevenat table instead of that
BSAD
BSAK
BSAS
BSID
BSIK
BSIM
BSIP
BSIS
etc.
Reward if useful!
‎2007 Jul 11 1:28 PM
Hi,
Try using the keys(BUKRS,BELNR,GJAHR,BUZEI) of the table BSEG in the where condition.
Generally the performance does improve if you utilize as many keys as possible in the where condition while selecting from a database table.
Thanks,
Sandeep.
‎2007 Jul 11 1:43 PM
Hi,
1) Try to create an index on BUZID field
2) Don't use SELECT/ENDSELECT statement. Instead of that extract all the concerned entries from BSEG into an internal table :
select belnr from bseg appending table itab where buzid = 'M'.
then do this :
sort itab by belnr.
describe itab lines n.
read table itab index n.
Please reward if helpful.
Regards,
Nicolas.
‎2007 Jul 11 1:51 PM
Use a combination of Sandeep and Nicolas's suggestions.
Definately try to narrow the selection by BUKRS,BELNR,GJAHR,BUZEI and read the result into an internal table before sorting for latest BELNR.
‎2007 Jul 11 2:26 PM
Well, BSEG is a cluster table, so you probably can't create a secondary index on it. I don't think there's much you can do here except run it in the bachground overnight when system load is light.
Rob