2-What is the difference between At New and On change Of
inside a loop??I want inside a loop difference not basic
difference??

Answer Posted / bhuvanya

Q. What is the difference between 'At New / End At' and 'On Change Of / EndOn'?
1. 'On Change Of' can be used in any loop construct, not just 'Loop At'.
2. A Single 'On Change Of' can be triggered by a change within one or more fields named after of and separated by OR.
3. When used within a loop, a change in a field to the left of the control level does not trigger a control break.
4. When used within a loop, fields to the right still contain their original values; they are not changed to contain zero or asterisks.
5. You can use 'else' statement between 'On Change OF' and 'End On'. You can also use ELSEIF statements in conjunction with special implementation of ON, but should always try to avoid this because they may not be supported in future.
6. You can use it with 'Loop At' IT WHERE clause……
7. You can use 'SUM' with 'On Change Of'. It sums all numeric fields except the one(s) named after Of.
8. Another difference is while using 'at new' in case if you code any write statements between 'at new' and 'end at' the value for the numeric fields will be returned as 0 and that of no numeric fields will be returned as *(asterisk). But in on change of the original values will be returned.

NOTE: Use the 'At First' and 'At Last' statement to perform during the first or last pass of internal table. These statements can only be used within 'LOOP AT'; they cannot be used within select.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Concepts of OO ABAP and why we are using it?

861


What is an Open Item in SAP? How will you find an Open Item in SAP?

628


Hi, I have a requirement for locking the fax field in user master records. As you know user can edit the details using the System>profile>own data (SU3), it is causing some security threat to our model. What i want is users should not be able to change the fax field under communications when they get into su3.I have heard of user Exist functionality but don't know how to implement it. Can you suggest something, it will be greatly appreciated.

1464


hi..i hav developed an interactive report in which alv list display in basic list and 1st secondary list in alv grid display.I want to get summation(total) of the columns in the secondary list.I hav used 'do_sum' but i couldnt get.is there any other way to get summation(total) in secondary list which is an alv grid display

2558


​​What is constructor expression in​​ nw​​ abap​​ 7.4?

636






Why do we use dynamic where conditions?

876


how to create view in bdc..??

2331


What kind of financial periods exist in SAP? What is the relevant table for that?

606


Mention what is alv programming in abap?

587


Can anyone done BDC/LSMW/BAPI for F-02 and F-04.If yes let me know the processs

1872


Difference between top-of-page and top-of-page during at line- selection?

1934


What are the arithmetic operators in the sap abap?

561


Cds views

7686


Example of table cluster and cluster tables.

653


Explain read dataset in sap abap?

720