2007 Sep 14 10:23 AM
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.
2007 Sep 14 1:28 PM
Hi,
1. Dont give select * in bseg. (Give fileds)
2. Maintain Key sequence in where caluse.
Regards.
2007 Sep 14 1:45 PM
hi
good
1-You are accessing data from the bseg table
2-use move corresponding in your select statement
thanks
mrutyun^
2007 Sep 14 3:15 PM
This is a duplicate post - please see my answer in the other one.
Rob
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |