Black Friday is ending this Friday! 40% off with coupon CYBER40 - Sign up here

Close

How To Fix EDOCUMENT166 - Unable to cancel document; Check method RESTRICT_CANCEL (BAdI ES_ADAPTOR)


EDOCUMENT166 - Overview

  • Message type: E = Error

  • Message class: EDOCUMENT - eDocument: Messages

  • Message number: 166

  • Message text: Unable to cancel document; Check method RESTRICT_CANCEL (BAdI ES_ADAPTOR)

  • Show details Hide details
  • What causes this issue?

    You are trying to cancel a document for which a corresponding eDocument
    exists. However, this action is not allowed if you are using the
    eDocument Basic Enablement.

    System Response

    The system does not allow you to cancel the source document.

    How to fix this error?

    Check if an implementation of the
    <DS:IO.IF_EDOC_ADAPTOR RESTRICT_CANCEL>Restrict
    cancellation of source document</>(RESTRICT_CANCEL) method of the
    eDocument Adaptor BAdI (EDOC_ADAPTOR) exists and if it allows the
    cancellation of the source document.

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

    Procedure for System Administrators


    Error message extract from SAP system. Copyright SAP SE.


EDOCUMENT166 - Details

  • The SAP error message EDOCUMENT166 indicates that there is an issue with canceling a document due to restrictions defined in the BAdI (Business Add-In) ES_ADAPTOR. This error typically arises when the system checks for conditions that prevent the cancellation of a document, and those conditions are not met.
    
    Cause: Business Logic Restrictions: The BAdI ES_ADAPTOR may have implemented custom logic that restricts the cancellation of certain documents based on specific criteria (e.g., document status, related documents, etc.). Document Status: The document you are trying to cancel may be in a status that does not allow for cancellation (e.g., already processed, posted, etc.).
    Configuration Issues: There may be configuration settings in the system that enforce restrictions on document cancellation.
    Solution: Check BAdI Implementation: Review the implementation of the BAdI ES_ADAPTOR to understand the specific conditions that are preventing the cancellation. You may need to consult with your ABAP developer or SAP consultant to analyze the logic. Document Status

    Already have an account? Login here!




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


EDOCUMENT166 - Related SAP Errors

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