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

Close

How To Fix VG228 - The system could not determine a unique contract number


SAP Error Message - Details

  • Message type: E = Error

  • Message class: VG - EDI Messages in SD

  • Message number: 228

  • Message text: The system could not determine a unique contract number

  • Show details Hide details
  • What causes this issue?

    The system could not determine a unique contract number with the
    selection criteria: external contract number &V1 and customer number
    &V2&.

    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?

    Procedure for System Administrators


    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message VG228 - The system could not determine a unique contract number ?

    Certainly! Here's a detailed explanation for the SAP error message VG228: The system could not determine a unique contract number:


    Error Message: VG228 - The system could not determine a unique contract number


    Cause:

    This error occurs when the SAP system tries to identify a contract number but finds multiple possible matches or none at all, making it impossible to determine a unique contract number for the transaction or process being executed.

    Common causes include:

    • Multiple contracts exist for the same criteria (e.g., same vendor, same material, same validity period), causing ambiguity.
    • Missing or incomplete data in the contract master or related tables.
    • Incorrect or missing selection criteria in the transaction or program that is supposed to fetch the contract.
    • Customizing or configuration issues where the system logic to determine the contract number is not properly set.
    • Data inconsistencies such as overlapping validity periods or duplicate contract entries.

    When does it typically occur?

    • During purchase order creation when referencing a contract.
    • When the system tries to automatically determine a contract number for a process like invoice verification, delivery, or goods receipt.
    • In automatic source determination scenarios.
    • In custom programs or user exits/enhancements that try to fetch contract numbers.

    Solution:

    1. Check the contract master data:

      • Verify that contracts are correctly maintained.
      • Ensure there are no duplicate contracts with overlapping validity periods for the same vendor/material combination.
      • Check that the contracts are valid for the date of the transaction.
    2. Review selection criteria:

      • Make sure the transaction or program has sufficient and correct selection criteria to uniquely identify a contract.
      • If you are using automatic source determination, check the configuration and master data.
    3. Adjust or enhance logic:

      • If this happens in a custom program or user exit, review the logic that fetches the contract number.
      • Add additional filters or logic to ensure uniqueness.
    4. Use transaction ME33K or ME33 to manually check contracts:

      • Identify contracts that match the criteria and see if multiple contracts exist.
    5. Check for data inconsistencies:

      • Run reports or queries to find duplicate or overlapping contracts.
      • Clean up or correct the data as necessary.
    6. Consult SAP Notes:

      • Sometimes SAP releases notes or patches related to contract determination issues.

    Related Information:

    • Transaction codes:

      • ME33K – Display Contract
      • ME32K – Change Contract
      • ME31K – Create Contract
      • ME21N – Create Purchase Order (where contract reference is often used)
    • Tables involved:

      • EKKO – Purchasing Document Header (contracts are stored here)
      • EKPO – Purchasing Document Item
      • EKKN – Account Assignment in Purchasing Document
      • EKBE – History per Purchasing Document
    • Configuration:

      • Automatic source determination settings in IMG under Materials Management ? Purchasing ? Source Determination.
    • SAP Notes:

      • Search for SAP Notes related to VG228 or contract determination issues in the SAP Support Portal.

    Summary:

    Aspect Description
    Cause Multiple or no contracts found matching the criteria, causing ambiguity in contract number.
    Solution Verify and clean contract data, ensure unique and valid contracts, adjust selection criteria.
    Related Use ME33K to check contracts, review automatic source determination config, check SAP Notes.

    If you provide more context (e.g., transaction, process, or custom code involved), I can help with more specific troubleshooting steps.

    • 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
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