Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

system fields

Former Member
0 Likes
671

Hi all,

can u please

what is the difference between sy-index and sy-tabix

thanks

swapna rani

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
652

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.

5 REPLIES 5
Read only

Former Member
0 Likes
653

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.

Read only

0 Likes
652

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

Read only

0 Likes
652

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.

Read only

0 Likes
652

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

Read only

Former Member
0 Likes
652

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