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


SAP Error Message - Details

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


Smart SAP Assistant

  • What is the cause and solution for SAP error message EDOCUMENT166 - Unable to cancel document; Check method RESTRICT_CANCEL (BAdI ES_ADAPTOR) ?
    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.


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