You are on page 1of 3

Function module: -

Functional modules are reusable components that are defined in functional library.

Each function module must be attached to one function group. Each contains two include programs by default.
One is for global declaration another one is for common subroutines. All the function modules can access the both the
include programs.
When ever we are calling any one of the function module then all other function modules will be loaded into the
memory of calling program. So it’s better to group related function module into one function group.

Note: - ‘SE37’ is the transaction code for function builder.

Steps to create function group: -

 Execute SE37.
 In the menu bar click on GO TO-->Function groups-->Create group(zsprao_fg).
 Provide the function group name & short description.
 Save. Click on local object.

Steps to activate function group: -

 In the menu bar click on environment-->inactive objects.


 Expand the function group under local objects.
 Select the function group-->Right click on it.
 Click active. Enter.

Components of function module: -

1. Attributes
2. Import
3. Export
4. Changing
5. Tables
6. Exceptions
7. Source code

Attributes: -
Attributes specify the type of function module whether it’s a normal or remote enable. If the function module type
is normal then we can access the function module within the server only.
If the function module type is remote enable then we can access the function module within the server as well as
outside the server also.
Import: -
Import acts like input parameters [using in the server].

Export: -
Export acts like output parameters [changing in the server].
Changing: -
Changing acts like both import & export.

Tables: -
Tables acts like both import & export only for internal tables.

Exceptions: -
These are used to handle the errors in function module.

Source code: -
It contains the logic related function module.

Difference between subroutines & function module: -


Object:- Develop a function module to display the all the purchasing order header details based on the given
purchasing document number.

Steps to create function module: -

 Execute SE37.
 Provide the function module name(zsprao_fm1).
 Click on create.
 Provide the function group name. Provide the short text. Click on save. Enter.
 Click on import.
 Provide parameter name, type, associated type.
I_EBELN type EKKO-EBELN
 Click on export.
 Provide parameter name, type, associated type.
E_WA TYPE EKKO
 Click on source code.
 Write source code.
Select single * from EKKO into E_WA where EBELN = I_EBELN.
Endfunction.
 Save, check, activate the function module.

Steps to call the function module: -


Place the cursor where you want to call the function module. Click on pattern in the application tool bar. Provide the
function module name.

You might also like