Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Program structure →  Introductory Statements for Programs 

FUNCTION-POOL

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


FUNCTION-POOL fpool [list_options] 
                    [MESSAGE-ID mid].

Effect

The FUNCTION-POOL statement introduces a function group. It must be the first statement of a standalone program after the triggering of possible include programs. The additions for the FUNCTION-POOL statement have the same function as the additions of the REPORT statement.

Function groups are maintained with the Function Builder tool of the ABAP Workbench; a framework program and subordinate include programs are generated automatically. The statement FUNCTION-POOL is created in the top include.

The full name of the framework program of a function group in the Repository consists of the prefix SAPL and the name fpool of the FUNCTION-POOL statement.

A function group serves as a frame for function modules and is organized in include programs as follows.

  • One top include with the prefix "L" and the ending "TOP" in the declaration section of the function group.
  • Optional include programs with the prefix "L" and the ending "D.." for declaring local classes within the top include.
  • One include program with the prefix "L" and the ending "UXX" in the implementation section of the function group. This include program includes include programs with the ending "U.." for implementing each function module of the function group. This structure must not be changed.
  • Optional include programs with the prefix "L" and the ending "P.." for implementing the methods of local classes in the implementation section of the function group.
  • Optional include programs with the prefix "L" and the ending "O.." for implementing PBO modules in the implementation section of the function group.
  • Optional include programs with the prefix "L" and the ending "I.." for implementing PAI modules in the implementation section of the function group.
  • Optional include programs with the prefix "L" and the ending "E.." for implementing event blocks in the implementation section of the function group.
  • Optional include programs with the prefix "L" and the ending "F.." for implementing subroutines in the implementation section of the function group.

The periods ".." represent a two-digit number. The functionality of the Function Builder is based on adherence to this naming convention.


Example

Function group SAPLABAP_DOCU is structured from include programs.

*&---------------------------------------------------------------------*
*&  Function Group SAPLABAP_DOCU
*&---------------------------------------------------------------------*

INCLUDE labap_docutop.               " Global Declarations

INCLUDE labap_docue00.               " Load of Program

INCLUDE labap_docuuxx.               " Function Modules

INCLUDE labap_docuo01.               " PBO Modules

INCLUDE labap_docui01.               " PAI Modules

INCLUDE labap_docue01.               " Handling of Runtime-Events

INCLUDE labap_docup01.               " Class implementations
INCLUDE labap_docup02.
INCLUDE labap_docup03.
INCLUDE labap_docup04.

The function group includes the top include in the first place; it contains the FUNCTION-POOL statement and other include programs for data and class declarations:

*&---------------------------------------------------------------------*
*&  Include           LABAP_DOCUTOP
*&---------------------------------------------------------------------*

FUNCTION-POOL abap_docu.

INCLUDE labap_docud00.               " Global Data for Screens

INCLUDE labap_docud01.               " Classes for Docu Display