Skip to Content
0
Former Member
Jan 13, 2006 at 12:29 AM

Performance

10 Views

Hi,

I am retrieving data from three tables using several loops .All the three tables contains

millions of records. Is there anyway to rewrite this logic so that I can increase the performance?

My code is:

SELECT FIELD1 FIELD2 FIELD3

FROM ZTABLE INTO TABLE I_TAB1

WHERE FIELD1 = 01

AND FIELD2 = 'P'

LOOP AT I_TAB1.

SELECT FIELD1 FIELD2 FIELD3

FROM DFKKCR INTO TABLE I_TAB2

WHERE FIELD1 = 'TEXT'.

AND FIELD2 = I_TAB1-FIELD2

AND FIELD3 = I_TAB1-FIELD3.

LOOP AT I_TAB2.

SELECT FIELD1 FIELD2

FROM DPAYH INTO TABLE I_TAB3

WHERE FIELD1 = I_TAB2-FIELD1

AND FIELD2 = I_TAB2-FIELD2.

LOOP AT I_TAB3.

SELECT FIELD1 FIELD2

FROM DPAYP INTO TABLE I_TAB4

WHERE FIELD1 = I_TAB3-FIELD1

AND FIELD2 = I_TAB3-FIELD2.

ENDLOOP.

ENDLOOP.

ENDLOOP.