2006 Jul 11 4:50 AM
Hi All,
How to find current number of record in internal table which is being processed.
Loop IN_TABLE.
**trap the current record number in internal table
ENDLOOP.
Thanks,
Pratibha.
2006 Jul 11 4:51 AM
Use the variable SY-TABIX. You can look at the SY-INDEX to find the no. of the loop.
Regards,
Ravi
2006 Jul 11 4:53 AM
Hi Pratibha ,
Use field SY-TABIX . This stores the current record number which is been processed .
Hope this helps .
Thanks ,
Shounak M.
2006 Jul 11 5:05 AM
Hi Pratibha,
<b> sy-tabix</b> is the system filed which gives the current record number in an internal table.
Regards!
2006 Jul 11 5:23 AM
Hi Pratibha,
<b>'SY-TABIX' </b>is the system field that holds the current number of record in internal table which is been processed.
Hope this helps you.
Cheers,
Anirban.
2006 Jul 11 5:32 AM
HI
GOOD
YOU CAN CHECK WITH SY-TABIX.
WHEN YOU DEBUG THE REPORT IN THE DEBUG MORE CLICK ON THE PARTICULAR ITAB IT WILL SHOW YOU THE FIELDS IT CONTAINS AND SY-TABIX VALUE LL BE DISPLAY DOWN ,OTHERWISE YOU CAN DIRECTLY USE IT IN YOUR REPORT.
THANKS
MRUTYUN
2006 Jul 11 5:35 AM
Hi Prathiba,
<b>SY-TABIX</b> hold the current index number of the record read in the LOOP pass. <b>SY-INDEX</b> has no effect in a LOOP...ENDLOOP statement. Only the system variable <b>SY-TABIX</b> is effected.
Consider this code.(Copy and execute you will come to kenow the role of SY-TABIX).
REPORT zztest.
DATA : it_mara TYPE STANDARD TABLE OF mara WITH HEADER LINE.
START-OF-SELECTION.
SELECT * FROM mara INTO TABLE it_mara UP TO 25 ROWS.
WRITE : /3(20) 'MATERIAL',
25(7) 'SY-TABIX',
33(8) 'SY-INDEX'.
SKIP 2.
LOOP AT it_mara.
WRITE : /3(20) it_mara-matnr,
25(7) sy-tabix,
33(7) sy-index.
ENDLOOP.
Regards,
Arun Sambargi.
2006 Jul 11 5:51 AM
Hi.
you can use SY-TABIX to find the current number of record.
SY-TABIX will give the index of current record being processed.
2006 Jul 11 6:08 AM
Hi,
As others have said, sy-tabix gives the current record of the itab when looping through it. Suppose I have an internal table with 10 records. On the first loop, sy-tabix gives you a value of 1 and on the second loop it gives you a value of 2 and so on. In SAP documentation it means:
Short text
Internal table, current line index
Definition
The number of the current line of the last internal table edited (when processing with the ABAP keywords LOOP, READ and APPEND).
Hope this helps.
P.S. Please award points for useful answers.