07-02-2007 6:54 AM
Hi ,
what is system variable to find the number of records in an internal table and what is the diff between sy-tabix and sy-index .
07-02-2007 6:56 AM
Hi..,
Sy-tabix works only with in a LOOP statement.
Sy-tabix gives the currently processing record number of the internal table inside the loop. sy-index doesnot work inside the loop .. endloop.
Sy-tabix works only with the Internal table operations..
sy-tabix always give the current processing record number in a particular internal table.
Sy-index works in processing loops.
sy-index gives the current loop pass number of the corresponding loop.
regards,
sai ramesh
07-02-2007 6:56 AM
Hi..,
Sy-tabix works only with in a LOOP statement.
Sy-tabix gives the currently processing record number of the internal table inside the loop. sy-index doesnot work inside the loop .. endloop.
Sy-tabix works only with the Internal table operations..
sy-tabix always give the current processing record number in a particular internal table.
Sy-index works in processing loops.
sy-index gives the current loop pass number of the corresponding loop.
regards,
sai ramesh
07-02-2007 6:57 AM
Hi,
system variable to find the number of records in an internal table - sy-tabix or sy-dbcnt.
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 belwo 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.
Regards,
Priyanka.
07-02-2007 6:58 AM
describe table itab lines N.
DESCRIBE is the statement which gives the number of records of an internal table
N returns the number of records of an internal table.
<b>Please close all your threads by assigning points to the useful answers</b>
Regards
Gopi
07-02-2007 6:58 AM
SYDBCNT will have the number of records in Itab and also u can use..
Describe table itab.
l_Var1 = sy-tfill..
This also will guive u the total records.
Sy-Tabix will have the index of the record which is coming in the itab.
Loop at itab.
SY-TABIX will have the index of the loop.
endloop.
07-02-2007 7:01 AM
Hi ,
The system variable which is used to find the no of records in internal table is sy-tfill..
describe itab .
if sy-subrc = 0.
n = sy-tfill.
endif.
Thanks & Regards
Bhaskar rao.M