Application Development 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: 

SY-TABIX

Former Member
0 Kudos

WHAT IS USE OF SY-TABIX.

5 REPLIES 5

former_member189059
Active Contributor
0 Kudos

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

varma_narayana
Active Contributor
0 Kudos

Hi..

SY-TABIX is a system field that stores the Currently processed row of internal Table.

For Eg:

READ TABLE ITAB WITH KEY MATNR = V_MATNR.

IF SY-SUBRC = 0.

WRITE:/ SY-TABIX. "To find the Index of the Row which is READ

<b>Reward if Helpful</b>

former_member189059
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

SY-TABIX is the Table index. It gives the Last addressed line of a standard table or sorted table. Is set to 0 if hashed table is accessed.

reward if useful.

Former Member
0 Kudos

Hi

The SY-TABIX is system field whic in available in syst structure.

when u process the internal table with in the loop, this field contain the no. of current loop pass , by sceeing this field u can tell how many time ur internal tableis process in the loop.

itab conrtina 2 record

data number(3) type n.

loop at itab .

number =sy-tabix.

endloop.

write: number.

output 2.

reward point if helpfull.

Anees