Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Declarative statemnts →  Typing →  Checking Typing 

Return Values of Functional Methods

The return value of a functional method is always fully typed and always passed on as a value. An actual parameter can be appended to the return value as follows:

If an actual parameter is specified explicitly after RECEIVING, this does not have to comply with the general typing rules for typing the formal parameter; instead, it is enough if the formal parameter can be converted to the actual parameter in accordance with the conversion rules.
If a function method is used at an operation position, the return value is used like a data object whose data type is determined by the full typing of the return value (a type-compatible actual parameter is implicitly associated with it). Checking of this typing is not necessary (or is always successful). An error always occurs, however, if the typing of the return value does not match the operand type.

Other versions: 7.31 | 7.40 | 7.54


Note

If reference variables are returned using RECEIVING, an up cast is possible, but a down cast is not.