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

Close

How To Fix WG158 - Condition for document type &1 for supply source key &2 was not met


SAP Error Message - Details

  • Message type: E = Error

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

  • Message number: 158

  • Message text: Condition for document type &1 for supply source key &2 was not met

  • 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 WG158 - Condition for document type &1 for supply source key &2 was not met ?

    Certainly! Here's a detailed explanation for the SAP error message:


    SAP Error Message:

    WG158 - Condition for document type &1 for supply source key &2 was not met


    Meaning / Cause:

    This error occurs during the creation or processing of a goods movement or procurement document when the system checks the conditions for the supply source (e.g., a plant, vendor, or storage location) and finds that the required condition for the specified document type and supply source key is not fulfilled.

    In other words, the system expects certain conditions or settings to be met for the combination of the document type (e.g., purchase order, stock transport order) and the supply source key (which identifies the source of supply, such as a plant or vendor), but these conditions are missing or incorrect.

    Common causes include:

    • Missing or incorrect configuration in the supply source determination.
    • The supply source key is not maintained or assigned properly for the document type.
    • The condition records or master data related to the supply source and document type are incomplete or inconsistent.
    • The system cannot find a valid supply source for the material or document type combination.

    Where it typically occurs:

    • During stock transport order processing.
    • When creating or processing purchase orders or goods movements involving supply sources.
    • In supply source determination steps in Materials Management (MM) or Warehouse Management (WM).

    Solution / How to fix:

    1. Check Supply Source Determination Configuration:

      • Go to transaction SPRO ? Logistics Execution ? Shipping ? Basic Shipping Functions ? Define Supply Source Determination.
      • Verify that the supply source key (&2) is correctly maintained and assigned for the document type (&1).
    2. Verify Condition Records:

      • Check if the condition records for the supply source and document type exist and are valid.
      • Use transaction MEK1/MEK2/MEK3 (for purchasing conditions) or relevant condition maintenance transactions.
    3. Check Master Data:

      • Ensure that the material master, vendor master, and plant data are correctly maintained.
      • Verify that the supply source (e.g., plant or vendor) is assigned to the material and document type.
    4. Review Document Type Settings:

      • Check the document type configuration in MM or SD to ensure it supports the supply source key.
      • Use transaction OMWN or relevant IMG paths to review document type settings.
    5. Supply Source Key Maintenance:

      • Maintain or correct the supply source key in the relevant customizing or master data.
      • For stock transport orders, check the shipping point and receiving plant assignments.
    6. Debugging / Logs:

      • If the above steps do not resolve the issue, perform debugging or check application logs (transaction SLG1) to get more detailed information on why the condition was not met.

    Additional Information:

    • The placeholders &1 and &2 in the message will be replaced by the actual document type and supply source key values when the error occurs.
    • This error is related to the supply source determination process, which is crucial for ensuring that materials are procured or moved from the correct source.
    • Proper configuration and master data maintenance are essential to avoid this error.
    • This message is often encountered in scenarios involving stock transport orders (STO) or special procurement types.

    Summary:

    Aspect Details
    Error Message WG158 Condition for document type &1 for supply source key &2 was not met
    Cause Missing or incorrect supply source condition/configuration for the document type & supply source key
    Solution Check and maintain supply source determination, condition records, master data, and document type settings
    Transactions to check SPRO, MEK1/MEK2/MEK3, OMWN, SLG1
    Related Areas Stock transport orders, purchase orders, supply source determination

    If you provide the actual values for &1 and &2, I can help you with more specific guidance.

    • 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's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker