At new - on change of difference: In case if you want calculate sub totals for same values in a field you can use the atnew statement.ie:
For example in a table sflight, there are 2 fields carrid ( airline id) and seatsmax( seat available). In case if you want calculate the total number of seats available for each carrrid you can sort the table first and using the at new and sum you can claculate the total seats for each carrid. Atnew will be triggered whenever there is a change in the carrid and the total seats will be returned for each carrid.
In the same scenario if you use onchange of it will not return the total seats for each carrid, instead it will return the total seat count for the entire table( ie: for all the carrids in the table. Another diffrence is atnew can be used only between loop and end loop whereas on change of can also be used in select- endselect , do -enddo. Another diffrence is while using atnew in case if you code any write statements between atnew and end at the value for the numeric fields will be returned as 0 and that of no numeric fields will be returned as *(asteriks). But in on change of the orginal values will be returned. Select single * and select upto 1 row diffrence.
The select single * from stmt selects only one row form the database table and puts it in to the work area(internal table). The select upto n(where n stands for a integer number) rows stmt selects all the rows from the database table but writes only the specified number of rows specified by the n into the internal table. If its given as upto 1 rows only 1 row is written in to the internal table.
Difference between BAPI and BDC
BDC vs BAPIWhat is the main difference between BAPI and BDC?ttttttBAPItttBDCtttttttttBAPI is used only when it is available for the particular transaction like Delivery Sales...
Difference between User Exit and Routines
Routines vs User Exit in SAPUser exitIn this step, you can implement the user exits listed below.You should carry out this step only if both of the followings apply:tThe SAP standard processes...
Difference between Collect and Sum
SUM vs. Collect in SAP ABAPSUMWhen processing an internal table in a block starting with LOOP and concluded by ENDLOOP, SUM calculates the control totals of all fields of type I, F and P and places...