Entering content frame

Overview documentation Overview of Function Modules Locate the document in its SAP Library structure

Function modules are ABAP routines that are stored in a central function library. They are not application-specific, and available systemwide. The ABAP Workbench comes with a large number of standard function modules.

Like form routines, function modules encapsulate program code, and provide an interface for data exchange.

However, there are significant differences between function modules and form routines:

The Function Builder allows you to develop, test, and document new function modules. You can also use it to display information about existing function modules:

Administration

Specifies information like the development class a function belongs to, the person responsible for the module, a short description of the module.

Import

Contains a list of the formal parameters that are used to pass data to a function module. For further information, refer to Displaying Information about Interface Parameters

Export

Contains a list of the formal parameters that are used to receive data from a function module. For further information, refer to Displaying Information about Interface Parameters

Changing

Contains a list of the formal parameters that are used both to pass data to and receive data from a function module. For further information, refer to Displaying Information about Interface Parameters

Tables

Specifies the tables that are to be passed to a function module. Table parameters are always passed by reference. For further information, refer to Displaying Information about Interface Parameters

Exceptions

Shows how the function module reacts to exceptions. For further information, refer to Displaying Information about Interface Parameters

Documentation

Provides information about the interface and exceptions

Source code

Program code of the function module

Global data

The global data used by the function module.

Main program

Program code of the main program.

 

Function modules play an important role in the modularization of applications. You can use them to encapsulate a particular function or group of related functions.

Modularization allows you to avoid redundancy. It also makes your programs easier to read and understand.
Modularized programs are easier to maintain and keep up-to-date.

The modularization principle:

This graphic is explained in the accompanying text

Function Groups

The Function Builder administers function modules that logically belong together in function groups. Function groups are containers for function modules. They can also contain global data declarations and subroutines that are available to all of the function modules in the group.

The following illustration shows the organization of function modules within a function group:

This graphic is explained in the accompanying text

For each function group <fgrp> there is a main program, generated by the system, called SAPL<fgrp>.
The main program contains INCLUDE statements for the following programs:

 

Displaying a Function Group

To display a function group, choose Goto ® Function groups ® Display group. A dialog box appears in which you can enter the name of the function group.

 

 

 

 

Leaving content frame