How To Fix WS158 - You cannot cancel - accounting document does not exist for document &1


SAP Error Message - Details

  • Message type: E = Error

  • Message class: WS - Supplier Billing Document

  • Message number: 158

  • Message text: You cannot cancel - accounting document does not exist for document &1

  • Show details Hide details
  • What causes this issue?

    The accounting document for document &V1& does not exist in the system.

    System Response

    The system does not allow cancellation of document &V1&, as further
    errors would then arise when the accounting document is created for the
    cancellation document.

    How to fix this error?

    Create a credit memo for document &V1& or change the
    <DS:DE.WFARTS>settlement document type for the reversal document</> of
    settlement document document type &V2& so that a credit memo can be
    created for document &V1&.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message WS158 - You cannot cancel - accounting document does not exist for document &1 ?

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


    SAP Error Message WS158

    Message Text:
    You cannot cancel - accounting document does not exist for document &1


    Cause

    This error occurs when you attempt to cancel or reverse a document in SAP, but the system cannot find the corresponding accounting document linked to the original document number you provided.

    In SAP, many business documents (like invoices, goods movements, etc.) generate accounting documents that record the financial impact. When you try to cancel or reverse a document, SAP checks for the related accounting document to reverse the financial postings. If the accounting document is missing or was never created, the system throws this error.

    Common reasons include:

    • The original document was created without generating an accounting document (e.g., a logistics document without financial impact).
    • The accounting document was deleted or archived.
    • You entered an incorrect document number or company code.
    • The document belongs to a different fiscal year or company code than expected.
    • The document is not yet posted or is still in a parked status.

    Solution

    To resolve the WS158 error, follow these steps:

    1. Verify Document Number and Company Code:

      • Double-check the document number you are trying to cancel.
      • Ensure you are using the correct company code and fiscal year.
    2. Check if Accounting Document Exists:

      • Use transaction FB03 (Display Document) or FBV3 (Display Parked Document) to check if the accounting document exists.
      • If the accounting document does not exist, cancellation is not possible because there is no financial posting to reverse.
    3. Check Document Type and Status:

      • Some documents (e.g., delivery notes) do not create accounting documents.
      • If the document is a logistics document without financial impact, you cannot cancel it via financial document reversal.
      • Instead, cancel or reverse the original document in the logistics module.
    4. Use Correct Cancellation Procedure:

      • For documents without accounting documents, use the appropriate cancellation transaction in the respective module (e.g., VL09 for delivery cancellations).
      • For documents with accounting documents, use FB08 or F.80 to reverse the accounting document.
    5. Check for Archiving or Deletion:

      • If the accounting document was archived or deleted, you cannot reverse it in the system.
      • Consult your SAP Basis or archiving team to retrieve or restore the document if necessary.
    6. Consult SAP Notes and Documentation:

      • Sometimes, specific SAP Notes address issues related to document reversal.
      • Check SAP Support Portal for notes related to WS158.

    Related Information

    • Transaction Codes:

      • FB03 – Display Accounting Document
      • FB08 – Reverse Accounting Document
      • VL09 – Cancel Goods Issue for Delivery
      • F.80 – Document Reversal
      • MBST – Cancel Material Document
    • Modules Involved:

      • FI (Financial Accounting)
      • MM (Materials Management)
      • SD (Sales and Distribution)
      • Logistics modules where documents may or may not generate accounting documents
    • SAP Notes:

      • Check SAP Notes for your SAP version if the problem persists.
      • Example: SAP Note 0000000 (replace with actual note number if available)

    Summary

    Aspect Details
    Error WS158 - You cannot cancel - accounting document does not exist for document &1
    Cause No accounting document linked to the document you want to cancel
    Solution Verify document/accounting document existence, use correct cancellation transaction
    Check Document number, company code, document type, document status, archiving/deletion status

    If you provide the document number and module context, 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
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