hi,
there is a concept of parallel cursor in SAP ABAP to avoid performance issues with nested loops with where condition.
data: lv_tabix type sy-tabix.
sort it_temp by lfbnr.
read table it_temp into wa_temp with key lfbnr = wa_resg-lfbnr.
if sy-subrc is initial.
lv_tabix = sy-tabix.
LOOP AT it_temp INTO wa_temp FROM lv_tabix.
if wa_resg-lfbnr <> wa_temp-lfbnr.
exit.
endif.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey = wa_temp-awkey BINARY SEARCH. " belnr = wa_temp-belnr BINARY SEARCH.
READ TABLE it_bset INTO wa_bset WITH KEY belnr = wa_bkpf-belnr kschl = 'JVRD'.
wa_final-belnr = wa_bkpf-belnr BINARY SEARCH.
lv_kbetr = wa_bset-kbetr / 10.
ENDLOOP.
thanks!!