Skip to Content
0
Former Member
Jun 11, 2007 at 07:08 AM

about mest loop

15 Views

hi forks,

i have some doubts about the nest loop

when i write the code in this type

loop at itab1 into lfc_itab1.

loop at itab2 into lfc_itab2 where k1 = lfc_itab1-k1.

......

endloop.

endloop.

but my leader told me to write in this way

sort itab2 by k1 ascending.

loop at itab1 into lfc_itab1.

read table itab2 with key k1 = lfc_itab1-k1 binary seach.

li_tabix = sy-tabix.

loop at itab2 form li_tabix.

if lfc_itab1-k1 = lfc_itab2-k1.

endif.

endloop.

endloop.

i also agree with what he said,but i write test code

it return the opposite result .i use record (100100,10001000,10000*10000)

dose anyone tell which will be better

thanks in advance