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

urgent....!!!

Former Member
0 Likes
1,297

Dear all,

Pls let me know diff b/w sy-tabix & sy-index?

Hoping for your Response...!!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,274

Hi ,

Sy-tabix is the index of Internal Table that will point current line

& Sy-index is the Index of loop Counter within a Internal Table.

Hope it helps...!!!

9 REPLIES 9
Read only

Former Member
0 Likes
1,274

HI,

If you use a condition in LOOP the sy-index will go from 1 to n, but sy-tabix will refer to the line in the internal table. Also, in the case of hash tables, sy-tabix will always be 0.

Sy-tabix is the tab index - the index of the record in the internal table you are accessing, and sy-index is the loop counter.

regards

Nicole

Read only

Former Member
0 Likes
1,274

Sy-tabix is used to find the current line in the internal table; it’s a current line index. Whereas

sy-index in used to find the number of current pass in the loop statement

Read only

Former Member
0 Likes
1,274

Hi,

Sy-tabix:

Its the index of current line when working with internal tables.

Sy-index.

Its the index of current pass when workin gwith loops.

Babul.

Read only

Former Member
0 Likes
1,274

hi ,

1. SY-INDEX is used to describe the number of iteration with in the DO..ENDDO, WHILE ...ENDWHILE....

SY-TABIX is used to define the iteration with in the internal table like between LOOP AT & ENDLOOP.

2. SY-TABIX : gives the Current line of an internal table

example

SEARCH T FOR 're'.

READ TABLE T INDEX SY-TABIX.

SY-INDEX : gives the Number of loop passes.

example

DO 5 TIMES.

WRITE: SY-INDEX.

ENDDO.

3. Sy-tabix is used to find the current line in the internal table; it’s a current line index, 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 is the number of Iterations for a loop. bascially DO - ENDO .

SY-INDEX is not equal to SY-TABIX.

some more info.............

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.

reagrds,

venkat.

Read only

Former Member
0 Likes
1,274

HI,

Sy-tabix is used to find the current line in the internal table; it’s a current line index. Whereas sy-index in used to find the number of current pass in the loop statement.

REWARD POINT IF HELPFUL

REGARDS,

PANKAJ

Read only

Former Member
0 Likes
1,275

Hi ,

Sy-tabix is the index of Internal Table that will point current line

& Sy-index is the Index of loop Counter within a Internal Table.

Hope it helps...!!!

Read only

Former Member
0 Likes
1,274

Hi Akhilesh,

Apart from these I want to add one thing.

If u select records from database table, Sy-tabix will be the no. of records fetched from that table.

E.g.: select matnr into table itab from mara where matnr in s_matnr.

sy-tabix = no.of records in Itab.

Regards,

Subbu

Read only

Former Member
0 Likes
1,274

Hi,

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.

SY-INDEX

In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,274

As far as i knoe.... tabix is for tab index. means where the control passes when we press the tab key. On the other hand, index contains the buffer index which contains the sequence in which the data will be accessed. I think this should solve the query.Still, consult 'Abap in 21 days' for further reference and clearance of thoughts.