2007 Jul 27 2:02 PM
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.
2007 Jul 27 2:06 PM
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
2007 Jul 27 2:08 PM
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.
2007 Jul 27 2:09 PM
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.
2007 Jul 27 2:12 PM
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
2007 Jul 27 2:27 PM
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 *
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |