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
Example of table cluster and cluster tables.
What are the parameters in bdc_insert? : abap bdc
What is value table?
What is the differences between abap and ooabap. In which situation we useooabap?
What is the use of lock objects?
Can a domain, assigned to a data element be changed? : abap data dictionary
How will you transfer data into a file in application server?
What are the update types possible? : abap data dictionary
What is asap methodology? : sap abap hr
how do you call third selection screen ?
What is the table buffer?
What is evaluation path, where do we do it and why? : sap abap hr
Hi to all abap gurus iam new to abap and my querry is as follows . and i feel so happy if u give exact anwers ? Querry1: i have one page( named "page1" )in my script with three windows(logo,adress,main windows) my requirement is to display some dynamic data in the script that is list of orders of the customer whn u give the customer number in selction-screen .then we can go for main window only to dispaly dynamic data ? or is there any other option ? then what should we give as apage number in the next page attribute in the header information. suppose if i dont give "page1" in the next page attribute as anext page what will happen ? i mean that dynamic data will be displayed or not ? Querry2: one one more querry incase if we have two pages in my layout .in page1 (3 windows as said above ) and page2 ( only logo and address window ) and no main window in page2. now if we give "page2" as next page in the next page attribute of page1 then that dynamic data will be displayed or not ?
What is a size category?
What are pooled tables?