ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements →  Classes and Interfaces →  Components in Classes and Interfaces →  Methods →  METHODS → 

METHODS - RETURNING

Short Reference

Syntax

METHODS meth [ABSTRACT|FINAL]
  [IMPORTING parameters [PREFERRED PARAMETER p]]
   [EXPORTING parameters]
    [CHANGING parameters]
  RETURNING VALUE(r) typing
  [{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}
  |{EXCEPTIONS exc1 exc2 ...}].

Addition:

... RETURNING VALUE(r) typing

Effect

This statement declares a functional instance method meth The same applies to the additions ABSTRACT, FINAL, IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS as to general instance methods.

A functional method can be called as a function in a suitable reader position.

Addition

... RETURNING VALUE(r) typing

Effect

Alongside any other formal parameters, a functional method has precisely one return value r declared using the addition RETURNING. The return value must be passed by value using VALUE and be fully typed using typing. In the typing check, special rules apply, depending on whether an explicit actual parameter is bound with RECEIVING or the functional method is used in an operand position.

Notes