Function Modules
Function Modules
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.
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.
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.