Rule Definition
During the processing of an update function module in the update work process, the statements COMMIT WORK and ROLLBACK WORK, as well as all other statements that create a database commit, must not be executed.
Any database commits or database rollbacks that occur within the update cancel the update.
Remediation
Remove COMMIT WORK and/or ROLLBACK WORK statement
Violation Code Sample
Sample 1
CALL FUNCTION 'Z_FMODULE' IN UPDATE TASK
EXPORTING
P_UNAME = sy-uname.
commit work.
-------------------------------------------------------
SAmple 2
CALL FUNCTION 'DEMO_UPDATE_DELETE' IN UPDATE TASK.
ROLLBACK WORK.
Fixed Code Sample
CALL FUNCTION 'Z_FMODULE' IN UPDATE TASK
EXPORTING
P_UNAME = sy-uname.
-----------------------------------------------
CALL FUNCTION 'DEMO_UPDATE_DELETE' IN UPDATE TASK.
Reference
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapcall_function_update.htm
Related Technologies
Technical Criterion
Programming Practices - Unexpected Behavior
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.