Video Lesson 10.1: ABAP Function Modules
In this lesson, you will learn how to create and use function modules. As an example, you will call a function module for the encapsulation of a SELECT in your program.
Working with Function Modules
A function module is a subroutine with the corresponding function that is centrally stored in the Function Library of the SAP system. Each function module has an interface for importing or exporting parameters. The main purpose of function modules is their reusability. Hence, they belong to the so called reuse components.
Function group
Function modules are organized into function groups. Each function group is a collection of function modules that have similar functions and/or process the same data.
A function group can contain the same components as an executable program. These include:
The interface of a function module can contain the following elements:
- Import parameters: They can receive the values or variables of the calling program when the function module is called.
- Export parameters: The calling program accepts the output of the function module through the assignment of a “receiving variable”.
- Changing parameters: It is possible to pass the variables of the calling program that are changed by the function module to the changing parameters.
- Exceptions: They can be triggered by the function module in certain error situations and provide information on the respective processing error in the function module.