‎2007 Oct 24 12:34 PM
Hi experts
I am supposed to use the following query, but it affects the performance badly, whats the way to solve this problem, pls help me on the same.
Thanks in advance
Regards
Rajaram
SELECT * FROM bseg
WHERE belnr = p_vblnr
AND gjahr = p_gjahr
AND koart = 'K'
AND bukrs = p_bukrs
AND bschl = '25'.
AND bschl IN ('25','38')
AND augbl NE p_vblnr.
SELECT * FROM bseg "24.09
WHERE belnr = p_vblnr
AND gjahr = p_gjahr
AND koart = 'K'
AND bukrs = p_bukrs
AND bschl = '29'.
‎2007 Oct 24 12:35 PM
‎2007 Oct 24 12:37 PM
Declare an internal tabel with the fields u actually and add " into table it_table" in your query instead of loading the table with buffered data. this will reduce the load
‎2007 Oct 24 12:37 PM
BUKRS
BELNR
GJAHR
BUZEI
BUZID
AUGDT
SELECT * FROM bseg
WHERE bukrs = p_bukrs
and belnr = p_vblnr
AND gjahr = p_gjahr
AND augbl NE p_vblnr
AND bschl IN ('25','38')
AND koart = 'K' .
SELECT * FROM bseg "24.09
WHERE AND bukrs = p_bukrs
and belnr = p_vblnr
AND gjahr = p_gjahr
AND bschl = '29'
AND koart = 'K' .
‎2007 Oct 24 12:50 PM
still the performance not improved, how can we solve this yar.
Regards
Rajaram
‎2007 Oct 24 12:46 PM
Hi Raja,
1. specify the field names instead of *
2. remove NE comparision in where clause, to avoid those entries do as below
SELECT <f1> <f2> ... FROM bseg into table itab
WHERE belnr = p_vblnr
AND gjahr = p_gjahr
AND koart = 'K'
AND bukrs = p_bukrs
AND bschl = '25'.
AND bschl IN ('25','38').
delete itab where augbl eq p_vblnr.
3. Use secondary indexes.
4. Maintain the fields in the where clause same as the order in database table.
<b>Reward for helpful answers</b>
Satish
‎2007 Oct 24 12:54 PM
Hi,
I would recommend only a single query & later on filter data .
SELECT * FROM bseg
WHERE bukrs = p_bukrs
and belnr = p_vblnr
AND gjahr = p_gjahr
AND bschl IN ('25', '29' , '38')
AND koart = 'K' .
‎2007 Oct 24 1:16 PM
no yar these two queries needs to be done two different conditions, so i can't do as you given.
‎2007 Oct 24 1:30 PM
‎2007 Oct 24 12:55 PM
form the <i>bschl</i> I see that yoe need vendor items. In this case select from BSIK and BSAK and not from BSEG.
‎2007 Oct 24 1:15 PM