0
"By simply looking at BAPI_TRANSACTION_COMMIT code, we see quickly what is different from COMMIT WORK. It calls BUFFER_REFRESH_ALL function module right after COMMIT WORK.
So BAPI_TRANSACTION_COMMIT additionally refreshes a ""BAPI buffer"".
Assuming your program calls BAPIs consecutively and use a COMMIT WORK/BAPI_TRANSACTION_COMMIT only at the end so that to commit all BAPI updates once (better performance).Let's suppose the update during the COMMIT WORK fails (for any reason), the data is not written to database. If you have not refreshed the buffer using BAPI_TRANSACTION_COMMIT, the next BAPI calls will consider that some data will exist later, that is wrong."
0
AT NEW and ENDAT is used to detect a change in the value of the field between the loop passes. The field that is specified in AT NEW is called control level. The code between AT NEW and ENDAT will be executed during the first loop pass and every time the value of the control level changes or any other field left to the control level changes. Between AT NEW and ENDAT all the fields in the work area that are right to the control level are filled with zeros and asterisks. We can declare a local workarea apart from Loop's work area to resolve this issue