COMMIT WORK belongs to the Open SQL command set.Return code valueThe SY-SUBRC is set to 0.

NotesAll subroutines called with PERFORM … ON COMMIT are processed in the LUW concluded by the COMMIT WORK command. All V1 update requests specified in CALL FUNCTION … IN UPDATE TASK are also executed in one LUW . When all V1 update requests have been successfully concluded, the V2 update requests (“update with start delayed”) are processed, each in one LUW . Parallel to this, the function modules specified in CALL FUNCTION … IN BACKGROUND TASK are each executed in one LUW per destination.COMMIT WORK commands processed within CALL DIALOG processing

– execute a database commit (see above),– close all open database cursors,– reset the time slice counter and– call the function modules specified by CALL FUNCTION INBACKGROUND TASK in the CALL DIALOG processing.

However, subroutines and function modules called with PERFORM … ON COMMIT or CALL FUNCTION … IN UPDATE TASK in the CALL DIALOG processing are not executed in the calling transaction until a COMMIT WORK occurs.Since COMMIT WORK closes all open database cursors, any attempt to continue a SELECT loop after a COMMIT WORK results in a runtime error. For the same reason, a FETCH after a COMMIT WORK on the now closed cursors also produces a runtime error. You must therefore ensure that any open cursors are no longer used after the COMMIT WORK .With batch input and CALL TRANSACTION … USING , COMMIT WORK successfully concludes the processing.

Addition… AND WAIT

EffectThe addition … AND WAIT makes the program wait until the type V1 updates have been completed.

The return code value is set as follows:

SY-SUBRC = 0 The update was successfully performed.SY-SUBRC <> 0 The update could not be successfully performed.

NoteRuntime errors

COMMIT_IN_PERFORM_ON_COMMIT : COMMIT WORK is not allowed in a FORM callled with PERFORM … ON COMMIT .COMMIT_IN_POSTING : COMMIT WORK is not allowed in the update task.