2007 Jul 25 7:55 AM
2007 Jul 25 7:56 AM
HI,
FOR sets SY-TABIX to the index of the table row, in which the search string was found.
Simply,
SY-TABIX-Current index of table
SY-INDEX-Current index of loop.
Regards,
Padmam.
2007 Jul 25 7:56 AM
HI,
FOR sets SY-TABIX to the index of the table row, in which the search string was found.
Simply,
SY-TABIX-Current index of table
SY-INDEX-Current index of loop.
Regards,
Padmam.
2007 Jul 25 7:57 AM
2007 Jul 25 7:58 AM
Hi,
SY-INDEX - Number of loop passes
SY-TABIX - Runtime: Current line of an internal table. table index
SY-TABIX means Table Index. This signifies the number of table index. Each row of a table has certain index or counter. The value of sy-tabix for the last entry would be equivalent to number of table entries.
SY-INDEX means the number of Iterations for a loop. bascially DO - ENDDO .
SY-INDEX is not equal to SY-TABIX.
sy-tabix inside loop-endloop, and sy-index inside do-enddo.
Check the belwo program
report tabix_index.
DO 100 times.
wa_tab-index = sy-index.
append wa_tab to itab.
clear wa_tab.
enddo.
loop at itab into wa_tab.
write:/1 sy-tabix.
endloop.
Regards,
Priyanka.
2007 Jul 25 8:00 AM
Hi,
sy-index --- It gives the iteration number..In which loop you are there.
sy-tabix --- Gives the row no of the table , which data record is gettiong read from the internal table.
Cheers,
Simha.
2007 Jul 25 8:01 AM
Hi,
SY-TABIX means Table Index. This signifies the number of table index. Each row of a table has certain index or counter. The value of sy-tabix for the last entry would be equivalent to number of table entries.
SY-INDEX means the number of Iterations for a loop. bascially DO - ENDO .
SY-INDEX is not equal to SY-TABIX.
Check the belwo program
report tabix_index.
DO 100 times.
wa_tab-index = sy-index.
append wa_tab to itab.
clear wa_tab.
enddo.
loop at itab into wa_tab.
write:/1 sy-tabix.
endloop.
I hope this answers your question.
reward if it helps..
Regards,
Omkar.
2007 Jul 25 8:04 AM
hi,
sy-tabix contains the current index number of internal table
sy-index contains the loop index no when we use any loops or index of database table also.
if helpful reward some points.
with regards,
Suresh Aluri.
2007 Jul 25 8:05 AM
Hi,
Sy-tabix is used to find the current line in the internal table; its a current line index. Whereas sy-index in used to find the number of current pass in the loop statement.
Could you please close the threads which you got the answers
Regards
Sudheer
2007 Jul 25 8:06 AM
Hi,
The following helps you.
Loops
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Internal Tables
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
reward if helpful.
Regards,
Karthick.