03-09-2007 7:16 PM
Hi,
Can anyone send me the exact difference between At-new and On change of
Thank You
Santosh
03-09-2007 7:19 PM
Hi,
at new - > means inside the loop, the new value.
eg :
1
1
2
3
4
5
5
loop at itab
at new matnr
write matnr.
end at.
end loop.
1
2
3
4
5
On change -> chnage of particular value inside the loop.
Regards,
Ferry Lianto
03-09-2007 7:25 PM
03-09-2007 7:34 PM
Hi,
Thanks for the reply .. But i could't get what you have written..
Any way thanks once again.. i just copied the answers you have sent in the previous post and unknowingly just pasted your name sorry..
Thanks and Regards
Anjali
mailid : sapcovet@yahoo.co.in
03-09-2007 7:57 PM
Hi ,
Here's the difference between At-new and On-change of...
At-New will trigger for every change in the values of the fields to the left of the field and the field it self where as On-change of will trigger only when there is change of the field value for that field.
For eg:
ITAB -- FLD1 FLD2 FLD3 FLD4
A B C D
A BB C D
A BB CC D
AA BB C D
AA BB CC DD
AA BBB CC DD
In the above example, On change of FLD2 is triggered for 3 times i.e
for ROW 1 --- when value of FLD2 is 'B',
ROW 2 --- when the value of FLD2 is 'BB' ( The field value for FLD2
was changed in this case)
ROW 6 - when the value of FLD2 was again changed to 'BBB'
Always, On-change of triggers whenever there is a change in the field value.
Coming to At-New of FLD2... this is triggered 4 times . At-New considers the change in the field FLD2 as well as the change in the FLD1 value. At new considers any changes to that field and any field to the left of it i.e..
ROW1 -- FLD1 = 'A' , FLD2 = 'B'
ROW2 -- FLD1 = 'A', FLD2 = 'BB',
ROW4 -- FLD1 = 'AA', FLD2 = 'BB',
ROW6 -- FLD1 = 'AA', FLD2 = 'BBB'
To understand in a better way , you can consider all the fields to the left of the AT-NEW field and the AT-NEW field as a string and can compare the value.
Hope this helps you in understanding the difference between AT-NEW and ON CHANGE..
Regards,
Kavitha
03-10-2007 5:14 PM
Hi Kavitha,
Thank you very much...
I understood the difference .. but if possible can you send me source code related to this question.
Thanks and regards
Anjali
03-09-2007 7:29 PM
AT NEW works only inside a loop and for a FIELD of an INTERNAL TABLE. Like this:
LOOP AT it_table.
AT NEW field.
....
ENDAT.
ENDLOOP.
ON CHANGE OF works for every VARIABLE, including a FIELD of an INTERNAL TABLE:
ON CHANGE OF variable.
or
ON CHANGE OF it_table-field.
But for ON CHANGE OF you don't have the AT END, AT FIRST or AT LAST equivalents because the system doesn't have a list of value, then there aren't a known next value, or if there are a next value.
TIP: If you use AT NEW you have to know that every field on right of the checked one is blancked between AT NEW and ENDAT. Be carefull with this. If you need the other values inside the AT NEW construction do that:
DATA: it_table TYPE STANDARD TABLE OF t_type WITH HEADER LINE,
line TYPE t_type.
LOOP AT it_table.
line = it_table
AT NEW field.
....
ENDAT.
ENDLOOP.
Then you can access LINE inside AT NEW construction with all values of actual IT_TABLE record.
Hope it helps.
Gastó
03-09-2007 7:37 PM
hi santhosh,
here i have mentioned some of the differences between at new and on change of statements.
on change of differs from at new in the following points.
1.on change of can be used in any loop such as select and end select, do-enddo,while-endwhile.
2.else can be used between on change of and endon.
3.on change of can be use with loop at itab where....
4.you can use sum with on change of. It sums all numeric field except the one named after of.
5. when used with in a loop, fields to the right still contain their original values.
Regards...
Arun.
Reward points if helpful.
03-09-2007 10:37 PM
Hi anjali,
I just entered your subject "difference between At-new and on change of" as search terms in the SEARCH FORUM input field.
Please check the results and come back after.
Difference between At new and On change of?
Posted on: 28.09.2006 19:01, by user: subhash soni -- Relevance: 100% -- Show all results within this thread
Hi What is the difference between At new and On change of? Thank You
difference between At-new and on change of
Posted on: 09.03.2007 20:16, by user: anjali nalluri -- Relevance: 89% -- Show all results within this thread
Hi, Can anyone send me the exact difference between At-new and On change of Thank You Santosh
Diff between AT new and on change of
Posted on: 30.11.2006 16:06, by user: Pavan Ravikanti -- Relevance: 53% -- Show all results within this thread
hi, can any one tell me what is the exact difference between <b>AT new</b> and <b>on change of</b> thanks pavan ...
Diff. between At New and On Change Of
Posted on: 05.10.2005 08:58, by user: surya mamtha -- Relevance: 48% -- Show all results within this thread
Hi, Could anybody exlain the difference between At New event and On Change Of event in detail? And how can we avoid the inner loops ...
Major Diff. Between On change of and At New
Posted on: 24.05.2006 12:48, by user: IFF -- Relevance: 46% -- Show all results within this thread
Hi Experts, Could you please let me know that what is the major difference between the control break statements On change of and At new. Which one is best to used ...
diff between at new and on change of
Posted on: 08.03.2007 16:27, by user: saroja ponnam -- Relevance: 44% -- Show all results within this thread
Hi all, what is the main diff between at new and on change of statements. Regards Saroja.
Differnce between AT NEW AND ON CHANGE OF
Posted on: 06.05.2006 10:55, by user: Raja Sekhar T -- Relevance: 44% -- Show all results within this thread
Hi, Differnce between AT NEW AND ON CHANGE OF Iam waiting foryour reply Thanks & Regards Raja Sekhar.T ...
Regards,
Clemens