Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select single * slows down report

Former Member
0 Likes
1,180

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,053

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

Read only

Former Member
0 Likes
1,053

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.

Read only

paruchuri_nagesh
Active Contributor
0 Likes
1,053

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

Read only

Former Member
0 Likes
1,053

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.

Read only

Former Member
0 Likes
1,053

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

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,053

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.

Read only

Former Member
0 Likes
1,053

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

Read only

harimanjesh_an
Active Participant
0 Likes
1,053

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

Read only

Former Member
0 Likes
1,053

This should be very quick, so your problem is likely elsewhere. Have you run ST05 on the report?

Rob