How To Fix AQ221 - Query & can only be started using a variant


SAP Error Message - Details

  • Message type: E = Error

  • Message class: AQ - Message texts for SAP Query

  • Message number: 221

  • Message text: Query & can only be started using a variant

  • Show details Hide details
  • What causes this issue?

    To execute this query, you must always specify a variant. You can do
    this only on the initial screen.

    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?

    Specify a variant on the initial screen of the component <LS>Maintain
    Queries</> screen.
    If you are not on the initial screen, you cannot execute the query
    directly. You must always return to the initial screen first.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message AQ221 - Query & can only be started using a variant ?

    The SAP error message AQ221 indicates that a query can only be executed using a variant. This typically occurs in the context of SAP Query or SAP Report transactions where a specific variant (a predefined set of parameters) is required to run the query.

    Cause:

    1. Missing Variant: The query you are trying to execute has been configured to require a variant, and you have not selected one.
    2. Query Configuration: The query may have been set up in such a way that it mandates the use of a variant for execution, possibly due to specific selection criteria or parameters that need to be predefined.
    3. User Permissions: In some cases, user permissions or roles may restrict the ability to run queries without a variant.

    Solution:

    1. Select a Variant:

      • When you attempt to run the query, look for an option to select a variant. This is usually available in the selection screen of the query.
      • If you do not have any variants created, you may need to create one by entering the desired selection criteria and saving it as a variant.
    2. Create a Variant:

      • Go to the selection screen of the query.
      • Enter the required parameters for the query.
      • Click on the "Save as Variant" button (often represented by a disk icon or similar).
      • Provide a name and description for the variant and save it.
      • After creating the variant, you can select it to run the query.
    3. Check Query Settings: If you have access, review the query settings to see if it can be modified to allow execution without a variant. This may require administrative privileges.

    4. User Roles and Permissions: Ensure that your user role has the necessary permissions to execute queries and manage variants.

    Related Information:

    • SAP Documentation: Refer to the SAP Help Portal or specific documentation related to SAP Query for detailed instructions on managing variants.
    • Transaction Codes: Familiarize yourself with relevant transaction codes such as SQ01 (SAP Query) and SQ02 (InfoSet) for creating and managing queries and variants.
    • Support: If you continue to face issues, consider reaching out to your SAP support team or consulting with an SAP expert for assistance.

    By following these steps, you should be able to resolve the AQ221 error and successfully execute your query using a variant.

    • 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