Skip to Content
0
Former Member
Jan 07, 2012 at 01:13 AM

Processing in 2 internal tables -Performance wise better option

28 Views

Hi Experts,

I have 2 internal tables.

ITAB1 and ITAB2 both are sorted by PSPHI.

ITAB1 has PSPHI some more fields INVOICE DATE and AMT

ITAB2 has PSPHI some more fields amount.

Both itab1 and itab2 will always have same amount of data.

I need to filter data from ITAB2 based invoice date given on selection screen.since ITAB2 doesnt have invoice date field.

i am doing further processing to filter the records.

I have thought of below processing logic and wanted to know if there is a better option performance wise?

loop at ITAB1 into wa where invoice_date > selection screen date. (table which has invoice date)

lv_index = sy-tabix.

read table itab2 where psphi = wa-psphi and index = lv_index.

if sy-subrc = 0.

delete itab2 index lv_index.

endif.

endloop.