2008 Feb 27 7:21 PM
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.
2008 Feb 27 7:30 PM
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
2008 Feb 27 8:25 PM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |