Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

regarding do loop.

Former Member
0 Likes
351

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

2 REPLIES 2
Read only

Former Member
0 Likes
326

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.

Read only

andreas_mann3
Active Contributor
0 Likes
326

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