FUNCTION MODULES
These are globally available sub-programs. These can handle exceptions. These can be called across different servers. We can create [Link] and [Link] in function-builder [[Link]-SE37]. We can create [Link] with in a function group. There are 3 types of [Link] : NORMAL F.M: These can be called within the server and across the client. REMOTE ENABLED F.M: These can be called across the servers. SYNTAX:
CALL FUNCTION 'FM1' DESTINATION 'SYS_200'. UPDATE F.M:
These can be called to update the D.B tables.
Components of F.M :
IMPORT: To define the I/p parameters for F.M. EXPORT: To define the O/p parameters for F.M. CHANGING: To define as both i/p and o/p parameters for F.M. TABLES: To define tables, here I tabs will be created with default W.A with
same name. EXCEPTIONS: To define user defines errors. SOURCE-CODE: The logic of the F.M can be written here with the help of above parameters.
FUNCTION-POOL
The statement FUNCTION-POOL declares a program in which you can define function modules. At runtime, function pool programs are loaded in to a new program group with their own user dialogs and their own shared data areas in the internal session of the calling program. For this reason, function groups (type F programs) must always begin with a FUNCTION-POOL statement.