difference between at new and on change of
pl its urgent
Answer Posted / suresh kumar
When we use At new for a field, it will trigger whenever
there is any change in all the fields from the left to that
of the particular field. But when we use On change of it
triggers only when there is any change in the particular field.
At new can only be used inside loop. On change of can used
outside the loop.
No logical Expressions can be added with at new. Logical
expression like OR can be used with on change of.
When AT NEW occurs, the alpha-numeric fields have * in their
value, where as in case of On Change, the alphanumeric
fields have their Corresponding value, of that particular
record, where the Event gets fired.
In the below code it matters with structure sequence.
If 1st column to be BUKRS and 2nd column to be F1 in ITAB
Structure then the At New event will show F1 column values
as '*' asterisks.
REPORT ZGSK.
*..........AT NEW Vs ON CHANGE OF EVENTs.............. *
DATA : BEGIN OF ITAB OCCURS 0,
F1(10) TYPE C,
BUKRS LIKE T001-BUKRS,
END OF ITAB.
ITAB-BUKRS = '1000'.
ITAB-F1 = 'ababcbcb'.
APPEND ITAB.
ITAB-BUKRS = '1100'.
ITAB-F1 = '1233333'.
APPEND ITAB.
ITAB-BUKRS = '1100'.
ITAB-F1 = '3333333'.
APPEND ITAB.
ITAB-BUKRS = '1200'.
ITAB-F1 = '555555'.
APPEND ITAB.
*AT NEW
LOOP AT ITAB.
AT NEW BUKRS.
WRITE :/ ITAB-BUKRS , ITAB-F1.
ENDAT.
ENDLOOP.
ULINE.
*AT ONCHANGE
LOOP AT ITAB.
ON CHANGE OF ITAB-BUKRS.
WRITE :/ ITAB-BUKRS , ITAB-F1.
ENDON.
ENDLOOP.
ULINE.
*AT ONCHANGE with Logical Expression "OR"
LOOP AT ITAB.
ON CHANGE OF ITAB-BUKRS or ITAB-F1.
WRITE :/ ITAB-BUKRS , ITAB-F1.
ENDON.
ENDLOOP.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
what are Hana Basics
What is the difference between data elements and domains? : abap data dictionary
how to update the filed value in SAP in ZAWSYS and create time and date? please tell me the answer
What are the dynamic actions and how to configure it? : sap abap hr
What is the last entry in all bdc tables? : abap bdc
Explain the uses of the simple maintenance interface? : sap abap hr
hi.. sap sd is installed in my PC .i m unable to start becoz ,i have given wrong password many times and it's locked.please tell me how can i open SAP logon. tell the process at my id dst.noida@rediffmail.com please advance thanx
What are the differences between the table and the structure in the data dictionary in the sap abap?
What is the difference between refresh and free statements?
What is the difference between a structure and an append structure?
What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
GUYS any one please can u post questions in sap a bap webdynpro questions.. please i need to know some technical questions regarding webdynpro and ADOBE forms ?
What is lock object ? : abap data dictionary
Which objects are independent transport objects?
What are lock objects?