SAP NetWeaver AS ABAP Release 752, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Program Layout → Modularization Statements → Procedures → Function Modules →
FUNCTION
Syntax
FUNCTION func.
*"---------------------------------------------------------
*" Local Interface:
*" parameter_interface
*"---------------------------------------------------------
...
ENDFUNCTION.
Effect
Between the statements FUNCTION and ENDFUNCTION, the functions of a function module func are implemented in a function group. The function module and its interface are defined in the Function Builder tool. In the source code of the function module, the function module interface defined in Function Builder is automatically displayed as parameter_interface in comment lines underneath the statement FUNCTION.
Within the function module, local data types and data objects can be declared. There is also access
to the formal parameters of the function module and to the global data types and data objects of the
function group. A function module is called using the statement CALL FUNCTION.
Note
The predicate expression
IS SUPPLIED can be used in the function module to determine whether an actual parameter has been specified for a formal parameter.
Example
Implements a function module that reads data in a table-like formal parameter flight_tab under the condition of an elementary formal parameter id. The parameter interface defined in Function Builder is visible as a comment.