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

Loop ... Endloop

Former Member
0 Likes
609

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
575

sy-tabix

5 REPLIES 5
Read only

Former Member
0 Likes
576

sy-tabix

Read only

0 Likes
575

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

Read only

0 Likes
575

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
575

Hi,

Its SY-TABIX.

Regards

Sesh

Read only

Former Member
0 Likes
575

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