โ2007 Nov 30 11:20 AM
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?
โ2007 Nov 30 11:31 AM
Hi,
Sy-tabix maintain effected row in internal table.
sy-index maintain index of DO loop.
L.Velu
โ2007 Nov 30 11:31 AM
โ2007 Nov 30 11:38 AM
Hi nagraj,
you want to say that in order to modify the internal table inside loop statement then i need to use sy-tabix and inorder to modify the internal table inside the do loop then i need to use sy-index.
is it ryt?
is it the same thing which you want to say?
Thanks & Regards,
Priyalatha
โ2007 Nov 30 11:40 AM
โ2007 Nov 30 12:09 PM
โ2007 Nov 30 11:31 AM
Hi,
Sy-tabix maintain effected row in internal table.
sy-index maintain index of DO loop.
L.Velu
โ2007 Nov 30 11:36 AM
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.