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

sy-tabix use in program

Former Member
0 Likes
700

Hi,

When we use sy-tabix in a program.

a perticular use??? situation use please..

regards,

venu.

Hi,

When we use sy-tabix in a program.

a perticular use??? situation use please..

regards,

venu.

2 REPLIES 2
Read only

Former Member
0 Likes
480

whenever you use LOOP ...... ENDLOOP statement...

the value of sy-tabix changes...

for first record, its 1 and so on.....

whenever you use a read statement....

sy-tabix contains the number of record which is read from the table...

I hope it helps..

situation can be different for different requirements..

basically it contains the index of the record which is used..

you can use it to number your records.. like 1 for first and 2 for second... etc....

Edited by: Sumeet Maheshwari on Feb 27, 2008 8:30 PM

Read only

Former Member
0 Likes
480

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

SY-TABIX

You can use the LOOP statement to process special loops for any internal table.

LOOP AT <itab> <result> <condition>.

<statement block>

ENDLOOP.

This reads the lines of the table one by one as specified in the <result> part of the LOOP statement. You can then process them in the statements within the LOOP... ENDLOOP control structure. You can either run the loop for all entries in the internal table, or restrict the number of lines read by specifying a <condition>. Control level processing is allowed within the loop.

The sequence in which the lines are processed depends on the table type:

Standard tables and sorted tables

The lines are processed according to the linear index. Within the processing block, the system field SY-TABIX contains the index of the current line.

Hashed tables

As long as the table has not been sorted, the lines are processed in the order in which you added them to the table. Within the processing block, the system field SY-TABIX is always 0.