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

Time out error

Former Member
0 Likes
1,204

Hi,

The below select statement is giving TIME_OUT error in production system.

SELECT filkd bukrs belnr buzei blart bldat bschl budat

dmbtr hkont kunnr rebzg mansp madat manst

shkzg umskz vbund xblnr

zbd1t zbd2t zbd3t zfbdt zterm

FROM bsid

INTO TABLE t_bsid

WHERE bukrs IN s_bukrs

AND kunnr IN s_kunnr

AND umskz IN s_umskz

AND augdt EQ w_augdt_null

AND augbl EQ w_augbl_null

AND budat <= p_keydat.

The select statement is using primary index but still it is causing time out error.Can anyone tell me how to improve the performance of this select statement?

12 REPLIES 12
Read only

Former Member
0 Likes
1,176

Hi,

SELECT filkd bukrs belnr buzei blart bldat bschl budat
dmbtr hkont kunnr rebzg mansp madat manst
shkzg umskz vbund xblnr
zbd1t zbd2t zbd3t zfbdt zterm
FROM bsid
INTO TABLE t_bsid
WHERE bukrs IN s_bukrs
AND kunnr IN s_kunnr
AND umskz IN s_umskz.

Loop at T_bsid.

IF augdt EQ w_augdt_null
AND augbl EQ w_augbl_null
AND budat <= p_keydat.

ENDIF.

ENDLOOP.

Decrease load on Database server.

Regards,

GP

Read only

Former Member
0 Likes
1,176

I hope you might be passing lot of data to this query, why dont you try the option to execute this report in background mode? So that ther will not be any timeout error?

Regards

Shiva

Read only

Former Member
0 Likes
1,176

what does the SQL Trace say?

The select statement is using primary index, the ABAP statement or the Explain statement.

How many records come back.

> Loop at T_bsid.

> IF augdt EQ w_augdt_null

> AND augbl EQ w_augbl_null

> AND budat <= p_keydat.

> ENDIF.

not recommended!!

Siegfried

Read only

ThomasZloch
Active Contributor
0 Likes
1,176

>

> Can anyone tell me how to improve the performance of this select statement?

Yes, provide a single value in S_BUKRS and S_KUNNR.

Thomas

Read only

Former Member
0 Likes
1,176

SELECT filkd bukrs belnr buzei blart bldat bschl budat

dmbtr hkont kunnr rebzg mansp madat manst

shkzg umskz vbund xblnr

zbd1t zbd2t zbd3t zfbdt zterm

FROM bsid

INTO TABLE t_bsid

WHERE bukrs IN s_bukrs

AND kunnr IN s_kunnr

AND umskz IN s_umskz

AND augdt EQ w_augdt_null

AND augbl EQ w_augbl_null

AND budat <= p_keydat. is ur statement

now using corresponding clause

SELECT filkd bukrs belnr buzei blart bldat bschl budat

dmbtr hkont kunnr rebzg mansp madat manst

shkzg umskz vbund xblnr

zbd1t zbd2t zbd3t zfbdt zterm

FROM bsid

INTO corresponding fields of TABLE t_bsid

WHERE bukrs IN s_bukrs

AND kunnr IN s_kunnr

AND umskz IN s_umskz

AND augdt EQ w_augdt_null

AND augbl EQ w_augbl_null

AND budat Le p_keydat. (insted of <= use le) this might improve performance of ur selct query.

and make sure that selection screen varables is of same time as u use in your internal table.

Read only

0 Likes
1,176

>

> AND budat Le p_keydat. (insted of <= use le) this might improve performance of ur selct query.

>

LE is the same as <=

WHERE filter as stated above must be more selective to force an indexed read .

bye

yk

Read only

0 Likes
1,176

Hi Yukon,

Now how can we improve the performance of this select statement?How can the index be more selective?

Read only

Former Member
0 Likes
1,176

the answer was already given, what is actually in the ranges????


WHERE bukrs IN s_bukrs
AND kunnr IN s_kunnr
AND umskz IN s_umskz

Only you can answer that!

Read only

0 Likes
1,176

Hi Siegfried,

The values for s_bukrs,s_kunnr and s_umskz given in selection screen are only single values.But even then the select statement is taking long time for execution and finally throwing TIME_OUT error.

Read only

Former Member
0 Likes
1,176

IF s_kunnr [] IS INITIAL.

"better trigger error message

SELECT bukrs belnr gjahr FROM bkpf by providing BUKRS , BSTAT ( ' ' , 'A' , 'B' etc ), BUDAT(obligatory) in the where condition.

do the second select from BSEG passing bukrs belnr year along with other parameter which u have..

ELSE.

ur SELECT

ENDIF.

Cheers

Read only

former_member506713
Participant
0 Likes
1,176

I suggest to run the report in background mode. It can avoid the time-out error.

Otherwise check with the proper index used from table BSID.

Regards

Lalit

Read only

Former Member
0 Likes
1,176

Hi,

you are selecting the data from the BSID table from your select statement the select fields order should not maintain the data base order , so that it takes lot of time ,change the fields order and run the program.

Regards,

Madhu