Error
Error Code:
139
SAP S/4HANA Error 139: Transaction Rollback Query Cancel
Description
This error indicates that an ongoing database transaction in SAP S/4HANA has been explicitly cancelled, leading to a rollback of all changes made within that transaction. It typically occurs when a user or an automated process aborts a long-running query or operation.
Error Message
Current operation cancelled by request and transaction rolled back
Known Causes
4 known causesUser Aborted Operation
A user manually stopped a long-running report, data import, or other transaction within SAP S/4HANA.
Query Timeout Exceeded
The operation exceeded configured system or database timeout limits, leading to an automatic cancellation and transaction rollback.
Database Concurrency Issue
The operation was cancelled by the database system to resolve a deadlock or severe concurrency conflict with other transactions.
External System Interruption
An integrated external system or interface unexpectedly terminated the request, forcing a rollback in S/4HANA.
Solutions
3 solutions available1. Identify and Terminate Hung SAP Transaction medium
Locate and end the SAP transaction that is causing the rollback.
1
Access the SAP system using SAP GUI.
2
Execute transaction SM50 (Work Process Overview) or SM66 (Global Work Process Overview).
3
Look for work processes that are in a 'Run' state but appear to be stuck or unresponsive. Pay attention to the 'User', 'Program', and 'Customer Function' columns to identify the specific transaction.
4
If a specific transaction is identified as the culprit, right-click on the corresponding work process and select 'Cancel' or 'Cancel with Core Dump' (use with caution). This will force the termination of the transaction and its associated database operations.
5
Confirm the cancellation when prompted. This action will trigger the rollback of the current operation.
2. Analyze Database Locks advanced
Investigate database locks that might be preventing transaction completion.
1
Access the SAP HANA database using a database administration tool (e.g., SAP HANA Studio, hdbsql).
2
Query the `M_LOCKS` system view to identify active locks and the transactions holding them.
SELECT * FROM M_LOCKS WHERE HOLDER_ID <> '' AND IS_WAITING = 'TRUE';
3
If a long-running or problematic lock is found, identify the `TRANSACTION_ID` associated with it.
4
Use the `ALTER SYSTEM KILL TRANSACTION <transaction_id>` command to terminate the blocking transaction. Replace `<transaction_id>` with the actual ID from the previous step.
ALTER SYSTEM KILL TRANSACTION '<transaction_id>';
5
Monitor the system to ensure the lock is released and the problematic transaction is rolled back.
3. Review SAP Application Server Logs medium
Examine application server logs for specific error messages preceding the rollback.
1
Access the SAP system using SAP GUI.
2
Execute transaction SM21 (System Log).
3
Filter the log entries by the time the error occurred. Look for entries with a high severity (e.g., 'A' for Abend) or specific error messages that might precede the 'Transaction Rollback Query Cancel' error.
4
Analyze the details of these preceding log entries. They might indicate issues with specific ABAP programs, function modules, or external interfaces that triggered the transaction to be cancelled.
5
Based on the log analysis, consult with SAP functional or development teams to address the underlying application issue.