Ansicht
Dokumentation
ABENBUILT_IN_FUNCTIONS_HIDING - BUILT IN FUNCTIONS HIDING
TXBHW - Original Tax Base Amount in Local Currency ABAP Short ReferenceThis documentation is copyright by SAP AG.
Built-In Functions, Hiding by Methods
Within a class, a built-in function is always hidden by methods of the class if they have the same name, regardless of the number and type of its arguments. The function is also hidden regardless of the number and type of method parameters. This especially takes place in method calls for which no selector => or -> is specified in front of the method name:
- A static method hides a built-in function with the same name in all methods of the associated class.
- An instance method hides a built-in function with the same name in the instance methods of the associated class.
The function is hidden regardless of the operand position. More specifically, any built-in functions called as arguments of other functions are also hidden.
Note
Methods should never be given the same name as a built-in function.
Example
The following class returns a syntax error. The specification of strlen on the right side of the assignment addresses the method of the class and not the built-in function. It cannot be specified in this operand position since it is not a functional method with a return value.
CLASS demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
CLASS-METHODS strlen IMPORTING text TYPE string
EXPORTING len TYPE i.
ENDCLASS.
CLASS demo IMPLEMENTATION.
METHOD main.
DATA(len) = strlen( `xxx` ).
ENDMETHOD.
METHOD strlen.
...
ENDMETHOD.
ENDCLASS.
TXBHW - Original Tax Base Amount in Local Currency ABAP Short Reference
This documentation is copyright by SAP AG.
Length: 2247 Date: 20240420 Time: 031134 sap01-206 ( 34 ms )