Skip to Content
-1
Dec 29, 2022 at 11:16 AM

Sy-TABIX into a LOOP AT and READ TABLE

358 Views Last edit Dec 29, 2022 at 11:19 AM 5 rev

Hi guys, there is someone can explain me what is the value of sy-tabix when it's into a LOOP AT stantment where I also have a READ table?
I declared a variable to maintain the index of my itab for deleting the row with condition, but why it doesn't work well if i just directly write : DELETE itab INDEX sy-tabix?

DATA: lv_tabix TYPE sy-tabix.

LOOP AT itab.

lv_tabix = sy-tabix.

READ TABLE itab2 WITH KEY werks = itab-werks BINARY SEARCH.
IF itab-daycont < itab2-switch.
DELETE itab INDEX lv_tabix. "istead of sy-tabix
ENDIF.
ENDLOOP.