0% found this document useful (0 votes)
4 views

Function Modules

Function Modules in SAP are reusable sub-programs stored in a central library, allowing them to be called from any program, including non-SAP systems. They consist of various components such as importing, exporting, changing parameters, internal tables, and exceptions to handle errors. The keyword 'CALL FUNCTION' is used in ABAP programs to invoke these Function Modules.

Uploaded by

gmbalaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Function Modules

Function Modules in SAP are reusable sub-programs stored in a central library, allowing them to be called from any program, including non-SAP systems. They consist of various components such as importing, exporting, changing parameters, internal tables, and exceptions to handle errors. The keyword 'CALL FUNCTION' is used in ABAP programs to invoke these Function Modules.

Uploaded by

gmbalaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Function Modules ( Tcode SE37 )

Function Modules are like procedures which are created and stored in the
central library and can be called from any program. Even the function modules
(RFC enabled) can be called from non-SAP systems.

Function Group
It is type ‘F’ program. Function groups are containers for function modules.
You cannot execute a function group. When you call a function module, the system
loads the whole of its function group into the internal session of the calling
program (if it has not already been loaded).

FUNCTION MODULES

Function Modules are sub-programs which contain set of re-usable statements with
importing, exporting parameters, exceptions. Unlike include programs Function
Modules can be executed independently.

Components of Function Module:

Import: These are input parameters of a Function Module.

Export: These are output parameters of a Function Module.

Changing: These are parameter which acts as importing and exporting parameters
to a Function Module.

Tables: These are internal tables which also act as importing and exporting
parameters.

Exceptions: Exceptions in Function Modules are used to catch certain type of


errors.

Using Function Modules in ABAP Programs


CALL FUNCTION is a keyword which is used to call a Function Module in
ABAP Programs.

FUN_MOD1:

Z = X + Y.
W = W + Z.

CHANGING:
REPORT ZDIV_PROG_FMOD1.

PARAMETERS: A TYPE I,
B TYPE I,
D TYPE I.
DATA C TYPE I.

START-OF-SELECTION.

WRITE:/ A, B, C, D.

CALL FUNCTION 'ZDIV_FMOD1'


EXPORTING
X =A
Y =B
IMPORTING
Z =C
CHANGING
W =D
.
WRITE:/ A, B, C, D.

You might also like