12-03-2007 8:57 AM
12-03-2007 9:00 AM
Function Modules are special external subroutine stored in a central library. The R/3 system provides numerous predefined function modules that you can call from the ABAP/4 programs.
All the function Modules are created under the Function Groups. Function Groups are nothing but the related group of function modules.
The function modules can be maintained through T.CodeSE37 and T.Code SE80.
In general the function module has the following components.
Documentation:
This is the place where you can find the discription/purpose of the function module.
Import & Export Parameters.
Import parameters correspond to the formal input parameters of subroutines. They pass data from the calling program to the function module.
Export parameters correspond to the formal input parameters of subroutines. They pass data from the function module back to the calling program.
Table Parameters.
Table parameters are internal tables. Internal tables are treated like changing parameters and are always passed by reference.
Exceptions.
Exceptions are used to handle error scenarios which can occur in the function modules. The function modules checks for any type of error and raise exception and returns SY-SUBRC value to the calling program.
Source Code:
the programming logic of the function module is written in this source code.
Rewards if useful.
12-03-2007 9:00 AM
Hi,
Import Export changing and exceptions are the parameters of FM
Regards,
Prashant
12-03-2007 9:01 AM
There are four types of parameters to a function module. They are used to get information into the module and get information out. Collectively, the parameters are known as the function module interface.
The four types are:
IMPORTING -> data going into the function module, that it will perform some action on
EXPORTING -> data returned by the function module
CHANGING -> data sent to the function module that maybe/is modified by the function module and returned to the caller
TABLES -> Tables sent to the function module - these are handled the same way as CHANGING parameters.
With recent ABAP, you can use table types with IMPORTING/EXPORTING/CHANGING parameters. You are not forced to use TABLES. With RFCs, however, it is better to use TABLES to pass table parameters.
matt
12-03-2007 9:09 AM
With recent ABAP, you can use table types with IMPORTING/EXPORTING/CHANGING parameters. You are not forced to use TABLES. With RFCs, however, it is better to use TABLES to pass table parameters.
The four types are:
IMPORTING -> data going into the function module, that it will perform some action on
EXPORTING -> data returned by the function module
CHANGING -> data sent to the function module that maybe/is modified by the function module and returned to the caller
TABLES -> Tables sent to the function module - these are handled the same way as CHANGING parameters.