Function modules are ABAP routines that encapsulate program code and provide an interface for data exchange. Function modules are stored in a central function library. They are not application-specific and are available system-wide. The ABAP Workbench comes with a large number of standard function modules.
Main Features
The main features of function modules are:
Function Groups
Function groups (also called function pools) are ABAP programs of a special type. They are the only program type that can contain function modules. Function modules are, in turn, procedures with public interface and are designed to be used by other programs. Function groups can contain global data declarations and subroutines that are available to all function modules in the group. In terms of object-oriented programming, a function group resembles a class and the function modules are its public static methods. Just like executable programs and module pools, function groups can also contain dynpros as their components, which is not possible in class pools. For that reason, you need to use function groups if you want to work with classical dynpros. The following figure illustrates the organization of function modules within a function group:
For each function group <fgrp> , the system generates a main program called SAPL<fgrp> . The main program contains INCLUDE statements for the following programs:
These include programs are generated by the Function Builder and may not be changed.
The naming convention for includes is the following (xx indicates a two-digit number):
In the top include, you can add include programs with the suffix "Dxx" for the declaration parts of local classes.