‎2010 May 05 1:51 AM
Hi SDN,
I am running a program, in a background Job, which writes a couple of Z tables, and calls some Function Modules.
But wherever there is a "COMMIT WORK" command within the process, the job crashes, with a short dump "MESSAGE_TYPE_X".
The Short text of error message is:
COMMIT WORK during ON COMMIT or ON ROLLBACK
I have tried replacing all these statements by "COMMIT WORK AND WAIT", but this also doesn't work (same error).
Please, does anyone know what is the problem here?
Do I have to remove all "COMMIT WORK" commands, including those from called Function Modules (which I haven't created) ??
What is the impact in the process if I do so ? Will the tables get updated as expected ?
Thanks a lot.
Cheers
‎2010 May 05 2:20 AM
Hello,
Please check the interface. The dump tells that there is something wrong with the COMMIT handling.
Seems it is not allowed to do any COMMITs or ROLLBACKs in the FM.
You should be able to find the cause during debugging the coding during the processing.
Regards,
David
‎2010 May 05 2:20 AM
Hello,
Please check the interface. The dump tells that there is something wrong with the COMMIT handling.
Seems it is not allowed to do any COMMITs or ROLLBACKs in the FM.
You should be able to find the cause during debugging the coding during the processing.
Regards,
David
‎2010 May 05 4:53 AM
Hi David,
thank you.
I cannot debug because this error only comes up when running in background mode.
Cheers
‎2010 May 05 4:57 AM
Looks like you are using COMMIT WORK inside some Update FMs or PERFORM ... ON COMMIT subroutines.
@David:
Seems it is not allowed to do any COMMITs or ROLLBACKs in the FM.
You can in normal FMs, but not in Update FMs.
Read this: [http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm]
‎2010 May 05 5:08 AM
Hi Suhas,
actualy, I have the error even using COMMIT WORK in the program, which is a simple Report.
Thanks,
Fabio
‎2010 May 19 6:10 AM
Hello Fabio,
would you please first check in ST22 where exactly this exception is raised? In your report or in the update function module?
It is clearly that it is caused by misuse statement listed below in the COMMIT WORK. You can first check if these statement is used somewhere in your program.
Within an update function module started using COMMIT WORK, the execution of statements that lead to a database commit is not permitted. In particular, the following are forbidden:
COMMIT WORK
ROLLBACK WORK
SUBMIT
CALL TRANSACTION
LEAVE TO TRANSACTION
CALL DIALOG
CALL SCREEN
Best Regards,
Jerry
‎2010 Jul 02 8:07 AM
The problem could only be fixed by splitting the process in 2 different Programs, called with statement Submit [PROGRAM], where the COMMIT command was placed in the second Program. By doing so, the first Program got isolate of the Commit statement, which has stopped the error to occur.