‎2007 Dec 30 2:55 PM
Hi all,
can u please
what is the difference between sy-index and sy-tabix
thanks
swapna rani
‎2007 Dec 30 2:58 PM
Hi Swapna,
SY-INDEX
SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.
Internal Tables
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 FOR sets SY-TABIX to the index of the table row, in which the search string was found.
Plzz Reward if it is useful,
Mahi.
‎2007 Dec 30 2:58 PM
Hi Swapna,
SY-INDEX
SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.
Internal Tables
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 FOR sets SY-TABIX to the index of the table row, in which the search string was found.
Plzz Reward if it is useful,
Mahi.
‎2007 Dec 30 3:00 PM
thanks for your fast rly and i have one more doubt what is SY-TFILL plz rly
is this also belonging to any internal table
thanks
swapna
‎2007 Dec 30 3:01 PM
SY-TFILL:
With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL is filled with the row number of the addressed internal table
See this link for system fields:
http://help.sap.com/saphelp_nw04/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm
Plzz Reward if it is useful,
Mahi.
‎2007 Dec 30 3:04 PM
thanks for your link it is very muchu help to me i have so many doubts in system fields
Edited by: swapna rani on Dec 30, 2007 4:05 PM
‎2007 Dec 30 3:10 PM
Hi Swapna,
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 below 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.
also go through below thread...
Hope it will solve your problem..
Reward points if useful..
Thanks & Regards
ilesh 24x7