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

keywords

Former Member
0 Likes
766

what is the exact purpose of keywords 'at new' and 'on change of' in abap.

what is the exact purpose of keywords 'at new' and 'on change of' in abap.

5 REPLIES 5
Read only

Former Member
0 Likes
737

Hi,

when a new record comes at new triggers.

atnew only used inside loop and endloop.

on change of works same like at-new but the diff is it can

be used out side of a loop,like select and endselect,case

endcase.

at new is controlbreak statment and on change of is not and

we can use onchange of out side the loop

and on at nnwe the left side feild change the event

trigers and the values become 0 and *

The Major difference between the two is that AT NEW can be

used ONLY for INTERNAL TABLES, while on change of can be

used for any loop processing i.e do..enddo, while..endwhile

and loop..endloop also.

Regards

Sudheer

Read only

Former Member
0 Likes
737

hi,

when a new record comes at new triggers.

atnew only used inside loop and endloop.

on change of works same like at-new but the diff is it can

be used out side of a loop,like select and endselect,case

endcase.

at new is controlbreak statment and on change of is not and

we can use onchange of out side the loop

and on at nnwe the left side feild change the event

trigers and the values become 0 and *

The Major difference between the two is that AT NEW can be

used ONLY for INTERNAL TABLES, while on change of can be

used for any loop processing i.e do..enddo, while..endwhile

and loop..endloop also.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Former Member
0 Likes
737

ON CHANGE OF <f> [OR <f1> OR <f2>...].

Opens an ON control structure, which ends with ENDON. The statement block is executed whenever the contents of the field <f> or one of the other fields <fi> has changed since the statement was last executed.

AT NEW <f>.

AT END OF <f>.

AT FIRST.

AT LAST.

AT <fg>.

The statements are used to process group levels within a loop using an extract dataset or an internal table. They introduce statement blocks that must be closed with ENDAT. The statements between AT and ENDAT are only executed if the corresponding group change occurred.

Read only

Former Member
0 Likes
737

Hi Sandeep,

both 'at new' and 'on change of' are use for conditionaly execute some statement.

suppose u have a int table with fields vbeln, vbdat, vbtyp.

if u use at new vbtyp then in loop pass either vbeln or vbdat chnage the conditional statement will fire.

but if u use on change of vbtyp, the conditional statement will fire if only vbtyp change.

regards

Krishnendu

Read only

Former Member
0 Likes
737

Hey Sandeep,

Check This Wud Help you...

In AT NEW (field)...

This event wil be triggered when ever a new item is found in that field & will also be triggered when there is a change in the field left to it...

In On Change Of field.

This event wil be triggered only if it encounters a change in the particular field you 've specified.

Hope this is simple & clear.

Reward If Useful *