Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Runtime Error MESSAGE_TYPE_X during COMMIT on Background Job

fabio_bellocchio
Participant
0 Likes
2,954

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

1 ACCEPTED SOLUTION
Read only

DavidLY
Product and Topic Expert
Product and Topic Expert
0 Likes
1,652

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

6 REPLIES 6
Read only

DavidLY
Product and Topic Expert
Product and Topic Expert
0 Likes
1,653

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

Read only

0 Likes
1,652

Hi David,

thank you.

I cannot debug because this error only comes up when running in background mode.

Cheers

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,652

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]

Read only

0 Likes
1,652

Hi Suhas,

actualy, I have the error even using COMMIT WORK in the program, which is a simple Report.

Thanks,

Fabio

Read only

JerryWang
Product and Topic Expert
Product and Topic Expert
0 Likes
1,652

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

Read only

fabio_bellocchio
Participant
0 Likes
1,652

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.