A transaction consistency check takes place when processing bgRFC units (language element CALL FUNCTION <func> IN BACKGROUND UNIT) which avoids ABAP language elements from being used in the unit execution of the application that could lead to a commit.
Synchronous and asynchronous RFCs (CALL FUNCTION <func> DESTINATION), WAIT, COMMIT WORK, ROLLBACK WORK, HTTP communication (using the class CL_HTTP_CLIENT), and calling the function module DB_COMMIT belong to these language elements. However, an explicit ROLLBACK WORK is not permitted. A message can however be executed with the statement MESSAGE.
While calling the ABAP language elements for the ABAP runtime error SYSTEM_ILLEGAL_STATEMENT, the execution of an implicit commit creates the ABAP runtime error DBIF_DSQL2_DEFAULT_CR_ERROR using the function module DB_COMMIT.
The reason for this check is that after a commit (for example, initiated by an RFC), all database actions previously executed in the unit (such as INSERT, MODIFY, UPDATE, and DELETE) are persisted on the database. If after this action the application terminates the related unit with an error (such as MESSAGE E, A, or X) then you cannot rollback the entire unit (Logical Unit of Work).
Executing the unit again would lead to the same database inconsistency.
You can change this runtime behavior by either deactivating transactional consistncy checks when creating bgRFC-Units (using the method IF_BGRFC_UNIT~DISABLE_COMMIT_CHECKS) or by modifying the application so that no actins are executed which could cause a commit or rollback.
Implementing the language element MESSAGE is permitted for logging errors.
Deactivating the consistency checks can only be done after the detailed analysis of the SAP LUW in the generated bgRFC unit. Otherwise data could be logged more than once by accident after the unit has been terminated.
The transactional integrity of a bgRFC unit canot be garanteed if the method DISABLE_COMMIT_CHECKS has been called.