‎2007 Oct 22 10:37 AM
hi guys,
how to tune up :
SELECT SINGLE * FROM bkpf WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr.
SELECT SINGLE * FROM bseg WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr
AND buzei EQ bsis-buzei.
these 2 really slows down the report
‎2007 Oct 22 10:40 AM
Hi,
It should not happen.
Can you check once again where is it taking more time.
These two should take very less time.
Regards,
Atish
‎2007 Oct 22 10:46 AM
well i suppose you got those 2 select single ´s in a loop, or even a nested loop.
and in this case, YEAH select single is SLOW.
what you can do:
- make an array fetch of bkpf and bseg into internal tables right at the start, and then do read table instead of selects in your loop..
- make NOT select single *, but select single fieldlist.
where fieldlist specifies the fields you need.
‎2007 Oct 22 10:47 AM
hi
if u r using non primary key fields in where condition of select single * then it slow down the report other wise it wont.
regards
Nagesh.Paruchuri
‎2007 Oct 22 10:48 AM
Hi,
Check whether u have mentioned the INTO workarea clause in your query...
Since u have used all the key fields with ur SELECT SINGLE query this will not cause performance issue...
Do reward points if useful..
Thanks and regards,
Litta.
‎2007 Oct 22 10:49 AM
Hi,
Instead of select single use the select into table with for all entries outside the loop . if u r fetching only one record use select single with alll key fields.
It will improve the performance.
Regards,
Nandha
‎2007 Oct 22 11:29 AM
You used all fields in the index, so this should not cause performance problems. It it is called many many times think about doing a prefetch of all nedded values at startup into an internal table.
‎2007 Oct 22 11:32 AM
SELECT SINGLE * FROM bkpf WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr.
SELECT SINGLE * FROM bseg WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr
AND buzei EQ bsis-buzei.
Are u using the Database table BSIS in the where clause.,.,it is a problem there fore it is taking time.
Instead first select the values of BUKRS,BELNR,GJAHR,BUZEI from the table BSIS.,.,into an internal table.
Then write the above select statement giving The internal Table name instade of the BSIS table name and Provide the INTO clause also .
Regards
Debasish
‎2007 Oct 22 12:28 PM
hi ester......
To improve the performance, u have to use <b>INTO</b> clause.....
<b>DATA : wa_bkpf TYPE bkpf,
wa_bseg TYPE bseg.</b>
SELECT SINGLE *
FROM bkpf
<b> INTO wa_bkpf</b>
WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr.
SELECT SINGLE *
FROM bseg
<b>INTO wa_bseg</b>
WHERE bukrs EQ bsis-bukrs
AND belnr EQ bsis-belnr
AND gjahr EQ bsis-gjahr
AND buzei EQ bsis-buzei.
This will definitely improve the performance.....
Reward me if useful...........
Harimanjesh AN
‎2007 Oct 22 3:04 PM
This should be very quick, so your problem is likely elsewhere. Have you run ST05 on the report?
Rob