Do you have any question about this error?
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
Routine &V1& contains one CEND
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
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.
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
andCENDIF
statements.Cause:
The error is caused by having an extra
CENDIF
statement in your code. In ABAP, everyIF
statement must have a correspondingENDIF
. If there are moreCENDIF
statements thanIF
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
andCENDIF
statements.Count the Statements: Ensure that each
IF
statement has a matchingCENDIF
. 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 anIF
, remove it.Check Nested Structures: If you have nested
IF
statements, ensure that each nestedIF
has its ownCENDIF
and that they are correctly matched.Syntax Check: After making changes, perform a syntax check on the program to ensure that there are no further issues.
Example:
Here’s a simple example to illustrate the issue:
IF condition1. " Some code ENDIF. IF condition2. " Some code ENDIF. CENDIF. " This will cause the error
In the above example, the last
CENDIF
is unnecessary and should be removed.Related Information:
By following these steps, you should be able to resolve the error and ensure that your ABAP code compiles and runs correctly.
Get instant SAP help. Start your 7-day free trial now.
P0788
The CIF statement may only be used within a routine
What causes this issue? The CSystem Response The system issues an error message and will not allow you to continue with this transaction until the e...
P0787
Routine & contains one ENDFORM statement too many
What causes this issue? Routine &V1& contains one ENDFORM statement too many.System Response The system issues an error message and will not...
P0790
The CENDIF statement may only be used within a routine
What causes this issue? The CENDSystem Response The system issues an error message and will not allow you to continue with this transaction until th...
P0791
Syntax of CIF statement in routine & is incorrect
What causes this issue? Syntax of CSystem Response The system issues an error message and will not allow you to continue with this transaction until...
Click on this link to search all SAP messages.