Stop googling SAP errors. Use our Free Essentials plan instead - no credit card needed. Start Now

Close

How To Fix WG221 - Assigned number of number range object & is in critical area


SAP Error Message - Details

  • Message type: E = Error

  • Message class: WG - Messages for store order and investment buy

  • Message number: 221

  • Message text: Assigned number of number range object & is in critical area

  • Show details Hide details
  • What causes this issue?

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

    System Response

    How to fix this error?

    Contact your system administrator.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message WG221 - Assigned number of number range object & is in critical area ?

    SAP Error Message:
    WG221 - Assigned number of number range object & is in critical area


    Cause:

    This error occurs when the number range object (e.g., for delivery documents, billing documents, etc.) is locked or currently being processed by another user or process. SAP uses number ranges to assign unique document numbers, and to avoid conflicts, it locks the number range object during number assignment. If a user or process tries to access the number range while it is locked (in a "critical area"), this error is triggered.

    In other words, the number range object is temporarily locked to ensure consistency and prevent duplicate number assignment, but another process is trying to access it simultaneously.


    Explanation:

    • Number ranges in SAP are managed centrally and locked during number assignment.
    • The "critical area" means the number range object is locked.
    • This can happen if a previous process did not release the lock properly (e.g., due to a dump, long-running transaction, or system issue).
    • It can also occur if multiple parallel processes try to assign numbers from the same number range simultaneously.

    Solution:

    1. Wait and Retry:
      Often, this is a temporary lock. Wait a few moments and try the transaction again.

    2. Check for Locked Number Range Objects:
      Use transaction SNRO (Number Range Objects) to check the status of the number range object:

      • Enter the number range object name.
      • Check if it is locked.
      • If locked, wait for the lock to be released.
    3. Check for Locked Entries in Table NRIV:
      The table NRIV stores number range intervals and locks. You can check if the number range object is locked here.

    4. Release Locks Manually (if necessary):

      • If the lock is not released due to a system crash or dump, you may need to manually remove the lock.
      • This should be done carefully by a BASIS administrator.
      • Use transaction SM12 to check for lock entries related to the number range object and delete them if appropriate.
    5. Check for Long-Running or Stuck Jobs:

      • Identify if any background jobs or processes are holding the lock.
      • Cancel or restart those jobs if necessary.
    6. Review Custom Code or Enhancements:

      • If custom code is involved in number assignment, ensure it handles locks properly.

    Related Information:

    • Number Range Object: A configuration in SAP that defines intervals of numbers for documents or master data.
    • Transaction SNRO: Used to maintain and check number range objects.
    • Table NRIV: Stores number range intervals and lock information.
    • Transaction SM12: Displays and manages lock entries in the system.
    • Common Scenarios: Delivery creation, billing document creation, material document posting, etc., where number ranges are assigned.

    Summary:

    Aspect Details
    Error WG221 - Number range object is in critical area (locked)
    Cause Number range object locked by another process/user during number assignment
    Solution Wait and retry; check and release locks via SNRO, SM12; check for stuck jobs or dumps
    Tools SNRO, SM12, NRIV table
    Precautions Avoid manual lock deletion without BASIS knowledge; investigate root cause of lock issue

    If the problem persists after these steps, consider involving your SAP BASIS team or SAP support for deeper analysis.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Sign up for our Free Essentials Plan.


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