2007 Jun 07 5:40 PM
DATA : BEGIN OF it_bkpf OCCURS 100,
bukrs LIKE bkpf-bukrs,
belnr LIKE bkpf-belnr,
gjahr LIKE bkpf-gjahr,
blart LIKE bkpf-blart,
budat LIKE bkpf-budat,
usnam LIKE bkpf-usnam,
dbblg LIKE bkpf-dbblg,
stblg LIKE bkpf-stblg,
stjah LIKE bkpf-stjah,
bktxt LIKE bkpf-bktxt,
grpid LIKE bkpf-grpid,
awkey LIKE bkpf-awkey,
tcode LIKE bkpf-tcode,
END OF it_bkpf.
SELECT bukrs belnr gjahr blart budat usnam dbblg stblg stjah
bktxt grpid awkey tcode
INTO TABLE it_bkpf
FROM bkpf
WHERE bukrs IN s_bukrs AND
budat IN postdate AND
blart IN s_blart AND
blart in s_blart1 and
usnam IN s_usnam
%_HINTS ORACLE 'INDEX(BKPF BKPF______Z1)'.
Could you please suggest what is wrong or how to tune this SELECT stmt?
2007 Jun 07 5:47 PM
Take out the hint and add all BSTAT to the WHERE.
Rob
2007 Jun 07 5:47 PM
Take out the hint and add all BSTAT to the WHERE.
Rob
2007 Jun 07 5:52 PM
This will be much faster:
SELECT bukrs belnr gjahr blart budat usnam dbblg stblg stjah
bktxt grpid awkey tcode
INTO TABLE it_bkpf
FROM bkpf
WHERE bukrs IN s_bukrs AND
bstat IN (' ', 'A', 'B', 'D', 'M', 'S', 'V', 'W', 'Z') AND
budat IN postdate AND
blart IN s_blart AND
usnam IN s_usnam.
Rob
2007 Jun 07 5:58 PM
hi,
for increasing perfomance of the select statement , check u r using the <b>Proper Index</b> of the table( table contains primary index and secondary index).
once u also check, u provide the low and high values to <b>s_bukrs</b> , <b>s_blart</b> , <b>s_usnam</b> all these fields( if u define using select-options statement) otherwise it will check from its low value to final value.
Keep the selected data amount be small.
for furthur refarence u follow these links.
http://www.sapbrain.com/ARTICLES/TECHNICAL/optimization/optimization.html
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abapPerformanceand+Tuning&
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
regards,
AshokReddy.