on 07-03-2007 3:08 PM
what is difference between AT NEW..... and ON CHANGE OF.......?
At new will be used only within the loop.......endloop.
the statements below that is executed only when there is any change in the value of the particular field.
loop at <itab>
At new <field>
...........
.................
endat.
endloop.
On change of can be used within loop....endloop, select.....endselect, while, Do.
On change of v1
..........
........
End on.
The statement b/w this is executed if there is any change in the value of the field during each loop pass.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi kadam,
AT NEW FIELD:
it compares with the previous record of the onternal table whether the value is different or not. if different this event is triggered. Used only ib LOOP AT i.e., only for internal table.
ON CHANGE OF:
it creates one more variable internally and check with the variable of the internal table. if different event is triggered.
initial value should mis-match. Used in DO, WHILE, LOOP AT..
generally we dont go for on change of.
luck,
pritam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I avoid both of those as they can cause problems. I do it with my own variables which gives me more control and doesnt hide any data!
Kind regards
Ash Thomas
Sap Consultant
<a href=http://www.ashpeople.com>Ash People, Sap Consultants & Sap Consultancy</a>
<a href=http://www.ashpeople.com>www.ashpeople.com</a>
AT NEW <field> is used when the field is a first element in the structure.
(IF the field used in AT NEW is not the first element in the structure, all the character field which cross in that loop will become ***, to overcome this ON CHANGE OF is used)
ON CHANGE OF <field> is used when the <field> is not the first element in the structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
AT NEW ONCHANGE
This is the event allowed only This is the event allowed only
with in the loop ...endloop. outside looping statements.
It considers the change in left This doesn't consider left side
side alphanumeric characters. alphanumeric characters.
Hope tis answer helps u.
Reward with points if ur question is answered.
Bye...........
Edited by: SreeRekha Myadam on Apr 8, 2008 11:05 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Both at new and on change are used within the loop.
But the difference is that on change will be triggered whenever the data in that particular field changes, at new is triggered whenever the data in the fields which are present before that control level changes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how to use at new and onchange control break events in ALV Programs........
thanks in advance...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
At new is trigger whenever there is any change in al lthe fields from the left to that of the particular field.
But On change is triggers only when there is any change in the particular field.
AT new we use with in the loop but onchange we can use outside the loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai,
At new and on change of both are used for displaying output.. The only difference is At new is used within the loop and On change of is used outside the loop... I hope this information may help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
at new
write kunnr, mandt.
endat.
o/p 123 *** ** .
set flag
at new
flag = `x`.
endat.
if flag = 'x'.
write kunnr, mandt.
endif
123 200.
ON CHANGE on problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.