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

AT NEW

Former Member
0 Likes
761

hey ABAP gurus

does SY-TABIX automatically increments when 'AT NEW' statement is used? if yes, then when does it increment....at the failure of condition or at the non failure??

please help me out with this. it is really urgent.

points will be rewarded

thanks rohit

hey ABAP gurus

does SY-TABIX automatically increments when 'AT NEW' statement is used? if yes, then when does it increment....at the failure of condition or at the non failure??

please help me out with this. it is really urgent.

points will be rewarded

thanks rohit

4 REPLIES 4
Read only

Former Member
0 Likes
737

Hi,

sy-tabix is used to count the number loops.

at new <field> event is triggered inside the loop if the field value is changed.

generally this event used for sort the field and sum of that particular field at top etc.

Regards,

Read only

Former Member
0 Likes
737

Hi Rohit,

SY-TABIX does not increment with AT NEW statement.

it increments only in the internal tables. for everry loop pass of internal table the SY-TABIX increments.

AT NEW is a control break command.

there is no effect on any system field with AT NEW statements. These Control Break statements are only used in loops.

reward if helpful

raam

Read only

Former Member
0 Likes
737

Hi,

We will use AT NEW in LOOP only.

So irrespect of AT NEW failure or success, each and every loop of internal table records sy-tabix will get increase.

Pls. reward if useful....

Read only

Former Member
0 Likes
737

Hi,

there are 2 system defined variables sy-tabix and sy-index.

Sy-tabix is incremented with in the loop. It indicated iteration number.

Sy-index is imcremented with in do and enddo.

There is no relation between sy-tabix and at-new.

At-new is the loop control statement.

It is triggered when the fields before the control level changes.Means that if you write

at-new field3.

It is triggered when The data present in the fields before field3 changes or the data present in field3 changes.

I think it is useful for you.