Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Program Layout →  Introductory Statements for Programs 

FUNCTION-POOL

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


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

Effect

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

Function groups are defined using the Function Builder tool in ABAP Workbench. Here, a master program and subordinate include programs are generated automatically. The statement FUNCTION-POOL is created in the top include.

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

A function group is used as a container 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 part 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 part 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 part of the function group.
  • Optional include programs with the prefix "L" and the ending "O.." for implementing PBO modules in the implementation part of the function group.
  • Optional include programs with the prefix "L" and the ending "I.." for implementing PAI modules in the implementation part of the function group.
  • Optional include programs with the prefix "L" and the ending "E.." for implementing event blocks in the implementation part of the function group.
  • Optional include programs with the prefix "L" and the ending "F.." for implementing subroutines in the implementation part of the function group.

The periods ".." represent a two-digit number. The functions in Function Builder are based on adherence to this naming convention.


Example

Constructs the function group SAPLABAP_DOCU 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. This include contains the statement FUNCTION-POOL 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