How To Fix 00085 - COMMIT WORK during ON COMMIT or ON ROLLBACK


SAP Error Message - Details

  • Message type: E = Error

  • Message class: 00 -

  • Message number: 085

  • Message text: COMMIT WORK during ON COMMIT or ON ROLLBACK

  • Show details Hide details


  • Self-Explanatory Message

    Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.

    To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.

    Unfortunately, there isn't any extra information in this error notice.



    What else can you do?

    First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).

    Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.

    You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.


Smart SAP Assistant

  • What is the cause and solution for SAP error message 00085 - COMMIT WORK during ON COMMIT or ON ROLLBACK ?

    The SAP error message "00085 COMMIT WORK during ON COMMIT or ON ROLLBACK" typically occurs in the context of ABAP programming, particularly when dealing with database transactions. This error indicates that there is an attempt to execute a COMMIT WORK or ROLLBACK WORK statement within a ON COMMIT or ON ROLLBACK event block, which is not allowed.

    Cause:

    1. Improper Use of COMMIT WORK/ROLLBACK WORK: The error arises when a program tries to commit or rollback a transaction while already in the process of handling a commit or rollback event. This is not permitted because it can lead to inconsistent states in the database.
    2. Event Handling Logic: The error may also occur if the logic in the event handling (like in a dialog program or a report) is incorrectly structured, leading to nested commit or rollback calls.

    Solution:

    1. Review Event Handling Logic: Check the code where the ON COMMIT or ON ROLLBACK events are defined. Ensure that you are not trying to call COMMIT WORK or ROLLBACK WORK within these event blocks.
    2. Refactor Code: If you need to perform a commit or rollback, do it outside of the event handling blocks. You can structure your code to handle the transaction logic before entering the event handling.
    3. Use Proper Transaction Management: Ensure that your transaction management is correctly implemented. Use COMMIT WORK and ROLLBACK WORK only in the main program logic, not in the event handlers.
    4. Debugging: If the error persists, use debugging tools to trace the execution flow and identify where the erroneous commit or rollback is being triggered.

    Related Information:

    • Transaction Management in ABAP: Understanding how transactions work in ABAP is crucial. Transactions are typically managed using COMMIT WORK to save changes and ROLLBACK WORK to discard changes.
    • Event Handling in ABAP: Familiarize yourself with how event handling works in ABAP programs, especially in dialog programs, to avoid such issues.
    • SAP Documentation: Refer to the official SAP documentation for more details on transaction management and event handling in ABAP.

    By following these guidelines, you should be able to resolve the error and ensure proper transaction handling in your SAP ABAP programs.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
The AI Support Assistant is great. It provides comprehensive assistance even on the most difficult issues. I highly recommend this service.
Rate 1
John Jordan
SAP Consultant & Author