‎2005 Mar 29 2:56 AM
hey guys
i have two questions.
1-Does the IN usage in Select query wont retrieve(see) index from table(ie.only = opertion will take index in query?)
SELECT BELNR BUZEI BLART MONAT MWSKZ HKONT SHKZG DMBTR
INTO CORRESPONDING FIELDS OF TABLE ITAB_TMP_BSIS1
FROM BSIS
WHERE BUKRS = ITAB_T001-BUKRS AND
GJAHR = P_GJAHR AND
MONAT IN R_MONAT.
2-I have do loop like this. where inside subroutine
i have few internal tables restricting values with respect to wk_monat.
(does this way of work takes more time in performance?,do we have any best way for this.)
do.
perform frm_read_data. " RE
wk_monat = wk_monat + 1.
if wk_monat > p_monat.
exit.
endif.
enddo.
ambichan.
Message was edited by: ambi chan
Message was edited by: ambi chan
‎2005 Mar 29 6:15 AM
Hi Ambi,
For your first query, a few points on indexing.
a) Indexing is based on the fields of the table and as far as my knowledge goes, one does not have to worry about the "compounding" clauses like AND, OR, NOT as long as field itself is present.(Someone correct me if I am mistaken here). So if your table is indexed on the following fields BUKRS, GJAHR and MONAT as the keys, then there is nothing to worry.
b) For your second part of the query, a few memory cycles are increased based on your coding:
You might as well, write:
while wk_monat < p_monat.
perform frm_read_data.
add 1 to wk_monat.
endwhile.
Easier to understand ,simple to code.
Regards,
Subramanian V.
‎2005 Mar 29 8:17 AM
Hi ambi,
Why don't you accept my advice to integrate the field
HKONT in your where-clause of your select-statement
I think , this will solve your performance problem
Another tip: to reduce the accounts in bsis and bsas you can
first select table glt0. If here's no entry you can exclude
the account from your select of bsis/bsas.
regards Andreas