Do you have any question about this error?
Message type: E = Error
Message class: P0 - Messages for Transactions PE01, PE02 and PE03
Message number: 790
Message text: The CENDIF statement may only be used within a routine
The 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.
P0790
- The CENDIF statement may only be used within a routine ?The SAP error message P0790, which states "The CENDIF statement may only be used within a routine," typically occurs in ABAP (Advanced Business Application Programming) when the CENDIF statement is used incorrectly outside of a defined routine or method. This error indicates that the CENDIF statement, which is used to close a conditional block that was opened with a C_IF statement, is not being used in the correct context.
Cause:
- Incorrect Placement: The CENDIF statement is placed outside of a method or function module, or it is not properly paired with a corresponding C_IF statement.
- Scope Issues: The C_IF and CENDIF statements must be within the same routine (like a method or function). If they are not, the ABAP compiler will throw this error.
Solution:
- Check the Structure: Ensure that the C_IF statement has a corresponding CENDIF statement and that both are within the same method or function module.
- Correct Placement: If the CENDIF statement is outside of a routine, move it inside the appropriate method or function module where the C_IF statement is defined.
- Review Code Logic: Make sure that the logic of your program is structured correctly. If you have nested conditions, ensure that each C_IF has a corresponding CENDIF.
Example:
Here’s a simple example to illustrate the correct usage:
FORM check_condition. DATA: lv_value TYPE i. lv_value = 10. IF lv_value > 5. " Some logic here ENDIF. " This CENDIF is correctly placed within the FORM routine ENDFORM.
Related Information:
By ensuring that your C_IF and CENDIF statements are correctly paired and placed within the same routine, you should be able to resolve the P0790 error.
Get instant SAP help. Start your 7-day free trial now.
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 ...
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...
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...
P0792
Attribute & is not supported
What causes this issue? You are using an invalid parameter with key word CSystem Response Correct routine &V1& and use report RPUGCC00 to ge...
Click on this link to search all SAP messages.