Ansicht
Dokumentation
ABENPREDICATIVE_METHOD_CALLS - PREDICATIVE METHOD CALLS
ROGBILLS - Synchronize billing plans CL_GUI_FRONTEND_SERVICES - Frontend ServicesThis documentation is copyright by SAP AG.
- Predicative Method Call
... meth( ... ) ...
Effect
A predicative method call is a relational expression whose only operand is a functional method call meth( ... ). The result of the relational expression is true if the result of the functional method call is not initial and false if the result of the functional method call is initial. The data type of the result of the functional method call, that is, the return value of the called function method, is arbitrary. A check is made for the type-dependent initial value.
A predicative method call, like any relational expression, can be a full logical expression or part of one. This means it can be specified as a condition in control statements and other statements, as an argument in Boolean functions or conditional expressions, or in combinations with Boolean operators.
Notes
- A predicative method call is a short form of the predicate expression:
- Predicate methods whose return value has the type abap_bool are particularly suitable for predicative method calls. Calling a predicate method in a predicative method call simulates the call of a method whose return value has the real Boolean data type that does not exist in ABAP.
- As usual, the functional method call meth( ... ) can be specified as an individual method or as a method chaining. If the first method called is an instance method, the functional method call can be introduced as usual using the instance operator NEW or the casting operator CAST.
- In addition to the dedicated predicate functions and an obsolete short form, predicative method calls are the only way of creating a relational expression using a single operand.
- For other expressions or data objects, the full predicate expression IS INITIAL or a comparison must be used to check the initial value but this is not recommended for many expressions anyway.
Example
Exit of the program if no SAP GUI is available. The called method check from the class CL_DEMO_SAP_GUI is a predicate method.
CPI1466 during Backup RFUMSV00 - Advance Return for Tax on Sales/Purchases
This documentation is copyright by SAP AG.
Length: 3938 Date: 20240426 Time: 140252 sap01-206 ( 62 ms )