How To Fix AJ021 - Output operand of variant can only be updated once


SAP Error Message - Details

  • Message type: E = Error

  • Message class: AJ - Billing program

  • Message number: 021

  • Message text: Output operand of variant can only be updated once

  • Show details Hide details
  • What causes this issue?

    The variant was set via the control so that only positive differences
    are permitted. In this case, an update can be carried out in a
    subsequent operand only.

    System Response

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.

    How to fix this error?

    Read about how you can avoid this case in the variant documentation.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message AJ021 - Output operand of variant can only be updated once ?

    The SAP error message AJ021, which states "Output operand of variant can only be updated once," typically occurs in the context of using variants in SAP reports or programs. This error indicates that there is an attempt to update an output operand (a variable or field that is meant to hold the result of a calculation or operation) more than once within the same execution context, which is not allowed.

    Cause:

    1. Multiple Updates: The most common cause of this error is that the output operand is being assigned a value multiple times in the same execution of the program or report.
    2. Incorrect Logic: There may be a logical error in the code where the output operand is inadvertently being updated in different branches of a conditional statement.
    3. Variant Configuration: If you are using a variant to run a report, the variant may be configured in such a way that it leads to multiple updates of the output operand.

    Solution:

    1. Review Code Logic: Check the code where the output operand is being assigned. Ensure that it is only assigned a value once during the execution of the program. You may need to refactor the code to avoid multiple assignments.
    2. Conditional Statements: If the output operand is being updated within conditional statements (like IF...ELSE), ensure that only one branch can execute that updates the operand.
    3. Debugging: Use debugging tools in SAP to step through the code and identify where the output operand is being updated multiple times.
    4. Check Variants: If the error occurs when running a report with a variant, review the variant settings to ensure that they do not lead to multiple updates of the output operand.

    Related Information:

    • SAP Documentation: Refer to SAP's official documentation for more details on error messages and their meanings.
    • SAP Community: Engage with the SAP Community forums where other users may have encountered similar issues and can provide insights or solutions.
    • Transaction Codes: Familiarize yourself with relevant transaction codes (like SE38 for ABAP programs) to analyze and modify the report or program causing the error.

    By following these steps, you should be able to identify the root cause of the AJ021 error and implement a solution to resolve it.

    • 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
ERPlingo simplifies finding the accurate answers to SAP message errors. I now use every week. A must have tool for anyone working with SAP! Highly recommended!
Rate 1
Kent Bettisworth
Executive SAP Consultant