ABAP Keyword Documentation →  ABAP − Reference →  Program structure →  Modularization Statements →  Procedures →  Function Modules →  FUNCTION → 

Function Module Interface

The parameter interface of a function module is defined in Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be raised by a function module. Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module. These represent the interface of the function module with the following syntax:

Syntax

... [IMPORTING parameters]
    [EXPORTING parameters]
          [TABLES table_parameters]
    [CHANGING parameters]
    [{RAISING exc1|RESUMABLE(exc1) exc2|RESUMABLE(exc2) ...}
    |{EXCEPTIONS exc1 exc2 ...}]

The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.

Note

The ABAP Development Tools do not have a form-based Function Builder and the parameter interface of a function module is defined in an ABAP pseudo syntax. These statements are not compiled like genuine ABAP statements and the regular ABAP syntax checks are not applied. When a function module is generated, they are interpreted like the form-based instructions from the classical Function Builder.

Interface Parameters

The interface parameters are defined on the relevant tab pages in Function Builder.

Note

The formal parameters of a function module can be registered as global parameters in Function Builder, however this is obsolete.

Exceptions

The exceptions of a function module are defined on the Exceptions tab page in Function Builder. Here exception classes can be selected to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.

The Resumable column in Function Builder can be selected to flag a class-based exception as a resumable exception. This places the RESUMABLE addition behind RAISING in the syntax above.

Note

For new developments, SAP recommends working with class-based exceptions that are independent of the function module.




Continue
Properties of Interface Parameters