‎2007 Jun 13 12:06 PM
Hi experts,
Which system variable(sy-xxxx) can be used to get the processing line number of an internal table in a loop?
Thx in advance.
Points will be rewarded.
Vincent
‎2007 Jun 13 12:07 PM
‎2007 Jun 13 12:07 PM
‎2007 Jun 13 12:12 PM
Hi Priyank,
yes. SY-TABIX.
But becareful that the sy-tabius hat not been changed by i.e. a form call,
loop at itab.
perform anything.
* usage of sy-tabix is dangerous because it may have been changed by anthing
endloop.Better:
data: lv_tabix type sytabix.
loop at itab.
lv_tabix = sy-tabix.
perform anything.
* usage of sy-tabix is dangerous because it may have been changed by anthing
* but using lv_tabix is fine
endloop.Regards,
Clemens
‎2007 Jun 13 12:25 PM
Hi,
SY-TABIX will change only if you use some APPEND or DELETE or INSERT statments in the loop, if you call a sub routine it will not have any effect.
Regards,
Sesh
‎2007 Jun 13 12:09 PM
‎2007 Jun 13 12:17 PM
Hi,
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index
tables. The field is either not set or is set to 0 for hashed tables.
Regards,
Bhaskar