Hi Guru's,
Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa
TRANSPORTING currcode. ) in the syntax
and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX sy-tabix FROM scarr_wa
TRANSPORTING currcode.) in the syntax.
in both case its working fine but i am not getting which one i have to use where to modify the internal table?
Hi,
generaly in DO loops we use sy-index and when we LOOP the internal tables then we use sy-tabix..
check the below link also
what-is-diff-bw-sy-index-and-sy-tabix
Regards,
Nagaraj
Hi Priya,
sy-tabix --->
Current line in an internal table. With the following statements SY-TABIX is set for index tables. With hashed tables, SY-TABIX is not filled or it is set to 0.
· APPEND sets SY-TABIX to the index of the last table row, that is the total number of entries in the target table.
· COLLECT sets SY-TABIX to the index of the existing or appended table row. With hashed tables, SY-TABIX is set to 0.
· LOOP AT sets SY-TABIX to the index of the current table row at the beginning of every loop pass. After leaving a loop, SY-TABIX is set to the value it had before entering the loop. With hashed tables, SY-TABIX is set to 0.
· READ TABLE sets SY-TABIX to the index of the table row read. If no row is found with binary search while reading, SY-TABIX contains the index of the next-highest row or the total number of rows +1. If no row is found with linear search while reading, SY-TABIX is undefined.
· SEARCH
Sy-index Contains the number of loop passes in DO and WHILE loops, including the current loop pass.
that is if 1 st time loop processing it is 1 if second time it is 2 etc...
Plz reward if help,
Mahi.
Add a comment