先READ,再LOOP FROM INDEX.
DATA:lv_index TYPE i.
SORT gt_ekbe BY ebeln ebelp.
LOOP AT gt_alv INTO gs_alv.
READ TABLE gt_ekbe INTO gs_ekbe WITH KEY ebeln = gs_alv-ebeln ebelp = gs_alv-ebelp BINARY SEARCH.
IF sy-subrc IS INITIAL.
lv_index = sy-tabix.
LOOP AT gt_ekbe INTO gs_ekbe FROM lv_index.
IF gs_ekbe-ebeln NE gs_alv-ebeln OR gs_ekbe-ebelp NE gs_alv-ebelp.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.