‎2007 Jul 13 2:30 PM
Hi experts,
Performance seems to take to long here in the select statement. Anybody knows a view table to enhance the selection? Thanks.
Retrieve data from LTAP
SELECT tanum
matnr
werks
charg
meins
qdatu
vsolm
maktx
lgort
FROM ltap
INTO TABLE i_ltap
FOR ALL ENTRIES IN i_ltak
WHERE tanum EQ i_ltak-tanum
AND matnr IN s_matnr
AND werks IN s_werks
AND qdatu IN r_date
AND lgort IN s_lgort
AND vltyp IN i_lgtyp.
‎2007 Jul 13 2:36 PM
Hi Marc,
Try to add the warehouse number (LGNUM) as this would then cover half of the key fields, which will make the DB to use primary key. Views without this field are not helpful as warehouse number is the most important classification element in WM module. hope this helps.
Regards,
Prabhu
‎2007 Jul 13 2:39 PM
Hi,
the first shot woudl be to check if internal table i_ltak is not empty -- since in this case you check only for rest of your condition for which no suitable index exist.
the best then would be create new index or restructure select in order to fit unde indexes of table LTAP
BR, Artem
remeber points
‎2007 Jul 13 2:49 PM
This'll be a lot faster:
RANGES: r_lgnum FOR ltap-lgnum.
r_lgnum-option = 'EQ'.
r_lgnum-sign = 'I'.
SELECT lgnum
FROM t300
INTO r_lgnum-low.
APPEND r_lgnum.
ENDSELECT.
CHECK NOT r_lgnum IS INITIAL.
SELECT tanum matnr werks charg meins qdatu
vsolm maktx lgort
from ltap
into table i_ltap
for all entries IN i_ltak
where tanum IN r_lgnum "<====
AND tanum EQ i_ltak-tanum
AND matnr IN s_matnr
AND werks IN s_werks
AND qdatu IN r_date
AND lgort IN s_lgort
AND vltyp IN i_lgtyp.
Rob
‎2007 Jul 13 2:50 PM
Hi Artem Ruzak,
What do you meant by creating new index, how do i do that? Thanks for your inputs.