2006 Sep 04 7:31 PM
hi,
can we give multiple fields in at new statement
regards,
siri.
2006 Sep 04 7:33 PM
Hi
No!
U can assign only one field, anyway remember that AT NEW <FIELD> is triggered if a value of a field at the left of <FIELD> is changing and not only if <FIELD> is changing.
Max
2006 Sep 04 7:33 PM
Hi
No!
U can assign only one field, anyway remember that AT NEW <FIELD> is triggered if a value of a field at the left of <FIELD> is changing and not only if <FIELD> is changing.
Max
2006 Sep 05 1:51 AM
Hi Sireesha,
As Max have said, you cannot declare multiple fields in at new statement. Also, when you declare AT NEW statement, it is best that you sort first your itab. Here is what will happen if you dont sort your itab:
contents of your itab:
FIELD1 | FIELD2
apple | carrot
banana | carrot
apple | delta
apple | delta
apple | delta
so when you loop at your itab:
loop at itab.
at new field2.
write: 'values of field2 changed.'.
endat.
endloop.
So logically the at new statement must trigger at the 3rd loop since your value of field2 changed from carrot to delta but it will triggeron the second loop since the value of field1 changed from apple to banana.
Hope this helps...
P.S. Please award points for useful answers.