I am wondering if anyone can optimize the following code:
LOOP AT dispinstock. SELECT matnr SUM( gesme ) SUM( verme ) SUM( einme ) SUM( ausme ) INTO (dispinstock-matnr, dispinstock-gesme, dispinstock-verme, dispinstock-einme, dispinstock-ausme) FROM lqua WHERE matnr = dispinstock-matnr AND lgnum = 'xxxxx' AND ( lgtyp IN zsd_t301_n OR ( lgtyp >= '900' AND lgtyp <= '903' ) ) GROUP BY matnr. MODIFY dispinstock. ENDSELECT. ENDLOOP.
dispinstock 170,000 entries,
LQUA 210,000 entries (there will be more> 1,500,000 entries coming soon)
This cycle takes more than 3 minutes. Would it be better to use a hash table instead? Any help or idea would be appreciated.
source share