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

Close

How To Fix W_CB391 - Company code &1 of sales org &2 <> company code &3 of contract


SAP Error Message - Details

  • Message type: E = Error

  • Message class: W_CB -

  • Message number: 391

  • Message text: Company code &1 of sales org &2 <> company code &3 of contract

  • 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 W_CB391 - Company code &1 of sales org &2 <> company code &3 of contract ?

    The SAP error message:

    W_CB391 Company code &1 of sales org &2 <> company code &3 of contract


    Meaning / Cause:

    This warning message occurs when there is a mismatch between the company code assigned to the sales organization and the company code assigned to the contract in a sales document or contract processing.

    • &1 = Company code of the sales organization
    • &2 = Sales organization
    • &3 = Company code of the contract

    In SAP SD (Sales and Distribution), each sales organization is assigned to exactly one company code. When creating or processing a sales document (e.g., a contract), the system checks if the company code of the sales organization matches the company code assigned to the contract. If they differ, this warning is triggered.


    Why does this happen?

    • The sales organization is linked to a different company code than the one assigned to the contract.
    • The contract might have been created under a different company code.
    • Master data inconsistency or incorrect assignment in organizational structure.
    • Possibly a cross-company code sales scenario, which is generally not allowed or requires special configuration.

    Solution:

    1. Check Organizational Assignments:

      • Verify the company code assigned to the sales organization in transaction OVX5 or via SPRO:
        • SPRO ? Enterprise Structure ? Assignment ? Sales and Distribution ? Assign Sales Organization to Company Code.
      • Ensure the sales organization is assigned to the correct company code.
    2. Check Contract Data:

      • Review the contract header data to see which company code it is assigned to.
      • If the contract was created under a different company code, consider creating a new contract under the correct company code or adjust the sales organization/company code assignment if business-wise correct.
    3. Adjust Master Data:

      • If the sales organization is incorrectly assigned to a company code, correct it.
      • If the contract is incorrectly assigned, recreate or adjust it.
    4. Cross-Company Code Sales:

      • If your business requires sales across company codes, you need to configure intercompany sales processes properly.
      • This involves setting up intercompany billing, intercompany pricing, and partner determination.
      • Note that standard sales documents are generally restricted to one company code.
    5. Ignore Warning (if appropriate):

      • Since this is a warning (W), not an error (E), you may proceed if the business process allows.
      • However, it is recommended to resolve the inconsistency to avoid issues in billing, accounting, and reporting.

    Related Information:

    • Transaction Codes:

      • OVX5 – Assign Sales Organization to Company Code
      • VA43 – Display Contract
      • VA42 – Change Contract
      • VA01 – Create Sales Order/Contract
    • SAP Notes / Documentation:

      • Check SAP Notes related to sales organization and company code assignment.
      • Review SAP SD organizational structure documentation.
    • Impact:

      • Mismatched company codes can cause issues in billing, accounting integration, and reporting.
      • Intercompany sales require special configuration and master data setup.

    Summary:

    Aspect Details
    Cause Company code of sales org differs from company code of contract
    Effect Warning message W_CB391 during contract or sales document processing
    Solution Align company code assignments between sales org and contract; check master data
    Additional For cross-company sales, configure intercompany processes properly

    If you provide more context (e.g., transaction used, business scenario), I can help 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
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