Skip to Content
0
Former Member
Jan 21, 2011 at 10:14 AM

Sy-tabix in relation to LOOP AT and READ TABLE

10476 Views

Hi All,

As per SAP documentation,

1) While looping through an internal table (LOOP AT), sy-tabix contains the index number of current row(for standard and sorted tables)

2)When successfully reading from an internal table(READ TABLE), sy-tabix is set to the index of the result row.

But what happens when READ TABLE is used while looping through another internal table?

i.e. Loop at TAB1...

.....

write sy-tabix.

READ TABLE TAB2...

write sy-tabix.

...

endloop.

If we are looping through 1st row of TAB1 and the result of read statement is found in 3rd row of TAB2, I expected that sy-tabix before READ would be 1 and after the READ be 3.

But, I found that sy-tabix remains unchanged at 1. Can someone expalin why?

Thanks,

Jagan