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

performance of select statement

Former Member
0 Likes
479

Hi everybody,

The following Select statement take to much of time.

first i am taking the doc.no based on the date interval

and after that with that doc.no and other criteria i am picking records

from bseg table but it taking much time.

please help me.

select belnr from bkpf into table it_doc

where bldat in s_bldat

and ( blart = 'CJ' or blart = 'KR'

or blart = 'KT' or blart = 'RE' or blart = 'RN' ) .

<b>

if not it_doc[] is initial.

sort it_doc by docno.

select * from bseg into table it_bseg

for all entries in it_doc

where belnr = it_doc-docno

and mwskz = p_mwskz

and gjahr = p_gjahr

and ( bschl = '40' or bschl = '31' OR BSCHL = '29' or

bschl = '83' or bschl = '86' ).

endif.</b>

Thanks in advance

V.Srinivasa rao.

Hi everybody,

The following Select statement take to much of time.

first i am taking the doc.no based on the date interval

and after that with that doc.no and other criteria i am picking records

from bseg table but it taking much time.

please help me.

select belnr from bkpf into table it_doc

where bldat in s_bldat

and ( blart = 'CJ' or blart = 'KR'

or blart = 'KT' or blart = 'RE' or blart = 'RN' ) .

<b>

if not it_doc[] is initial.

sort it_doc by docno.

select * from bseg into table it_bseg

for all entries in it_doc

where belnr = it_doc-docno

and mwskz = p_mwskz

and gjahr = p_gjahr

and ( bschl = '40' or bschl = '31' OR BSCHL = '29' or

bschl = '83' or bschl = '86' ).

endif.</b>

Thanks in advance

V.Srinivasa rao.

3 REPLIES 3
Read only

Former Member
0 Likes
459

Hi,

1. Dont give select * in bseg. (Give fileds)

2. Maintain Key sequence in where caluse.

Regards.

Read only

Former Member
0 Likes
459

hi

good

1-You are accessing data from the bseg table

2-use move corresponding in your select statement

thanks

mrutyun^

Read only

Former Member
0 Likes
459

This is a duplicate post - please see my answer in the other one.

Rob