Do you have any question about this error?
Message type: E = Error
Message class: P0 - Messages for Transactions PE01, PE02 and PE03
Message number: 787
Message text: Routine & contains one ENDFORM statement too many
Routine &V1& contains one ENDFORM statement too many.
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.
P0787
- Routine & contains one ENDFORM statement too many ?The SAP error message "P0787 Routine & contains one ENDFORM statement too many" typically indicates a problem in an ABAP program where there is an imbalance in the number of
FORM
andENDFORM
statements. This error occurs when the ABAP runtime detects that there is an extraENDFORM
statement that does not correspond to aFORM
statement.Cause:
- Extra ENDFORM Statement: The most common cause is that there is an
ENDFORM
statement that does not have a matchingFORM
statement.- Misplaced ENDFORM: Sometimes, the
ENDFORM
might be placed incorrectly within the code, leading to confusion in the structure of the program.- Nested FORM Routines: If you have nested
FORM
routines, ensure that eachFORM
has a correspondingENDFORM
and that they are properly nested.Solution:
- Check the Code: Review the ABAP code for the routine mentioned in the error message. Look for the
FORM
andENDFORM
statements and ensure that they are correctly paired.- Count Statements: Count the number of
FORM
andENDFORM
statements in the routine. They should match in number.- Indentation and Formatting: Properly indent and format your code to make it easier to spot mismatched statements.
- Remove Extra ENDFORM: If you find an extra
ENDFORM
, remove it or adjust the code to ensure that it matches the intended logic.- Check Nested Routines: If you have nested routines, ensure that the nesting is correct and that each
FORM
has a correspondingENDFORM
.Related Information:
FORM
and ENDFORM
statements.By following these steps, you should be able to resolve the error and ensure that your ABAP program runs correctly.
Get instant SAP help. Start your 7-day free trial now.
P0786
A CENDIF statement is missing in routine &
What causes this issue? A CENDSystem Response The system issues an error message and will not allow you to continue with this transaction until the ...
P0785
Routine & does not finish with an ENDFORM statement
What causes this issue? There is no ENDFORM statement in routine &V1&.System Response The system issues an error message and will not allow ...
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...
P0789
Routine & contains one CENDIF statement too many
What causes this issue? Routine &V1& contains one CENDSystem Response The system issues an error message and will not allow you to continue ...
Click on this link to search all SAP messages.