How To Fix P0789 - Routine & contains one CENDIF statement too many


P0789 - Overview

  • Message type: E = Error

  • Message class: P0 - Messages for Transactions PE01, PE02 and PE03

  • Message number: 789

  • Message text: Routine & contains one CENDIF statement too many

  • Show details Hide details
  • What causes this issue?

    Routine &V1& contains one CEND

    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?

    Correct routine &V1& and use report RPUGCC00 to generate another
    personnel calculation rule check. If this is a routine delivered by
    SAP, please contact the SAP telephone service.

    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message P0789 - Routine & contains one CENDIF statement too many ?
    The SAP error message "P0789 Routine & contains one CENDIF statement too many" typically occurs during the execution of ABAP programs or during the compilation of ABAP code. This error indicates that there is a mismatch in the control structures of the code, specifically with the IF and CENDIF statements.
    
    Cause: The error is caused by having an extra CENDIF statement in your code. In ABAP, every IF statement must have a corresponding ENDIF. If there are more CENDIF statements than IF statements, the compiler will raise this error.
    Solution: To resolve this error, you should: Review the Code: Go through the ABAP code where the error is reported. Look for the IF and CENDIF statements. Count the Statements: Ensure that each IF statement has a matching CENDIF. You can do this by counting the occurrences of each statement. Remove Extra CENDIF: If you find an extra CENDIF that does not correspond to an IF, remove it. Check

    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
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker