Types of Function module in Sap ?
Sap is having totally 3 types of function module with its own capabilities
1) Normal Function Module
2) RFC Function Module
3) Update Function Module
Normal Function Module:
A normal or Regular Function Module is the default option. This kind of Function Module is executed immediately and synchronously on your current SAP system.
CALL FUNCTION func { parameter_list | parameter_tables }.
RFC Function Module:
Remote function module is most widely used one in sap. The feature of this RFC is it can communicate within sap and outside sap if the function module is defined at the destination
Syntax : CALL FUNCTION func DESTINATION dest parameter_list
These RFC's can be managed under the transaction code: Sm59
Update Function Module:
Update Function Modules don't run right away; they are scheduled to run later in a process called an update work process. You start this update process by using the statement COMMIT WORK. If you want to cancel all the update function modules you've scheduled, you can use the statement ROLLBACK WORK. By using CALL FUNCTION .. IN UPDATE TASK, you can group together changes to the database into a single unit of work. This is helpful for performance because the updates occur in the background, making things faster
Parameters in FM:
1) Attributes
2) Import
3) Export
4) Changing
5) Tables
Recommended by LinkedIn
6) Exception
7) Source Code
ATTRIBUTES:
In the Attributes section, you'll find details such as the Function Group name, Function module type, responsible person, change date, Program, and Include Name
IMPORT PARAMETERS:
These parameters are used for passing values into the function module. The values are provided by the calling program or function module.
EXPORT PARAMETERS:
These parameters are used for returning values from the function module to the calling program or function module.
CHANGING PARAMETER:
These parameters are used for passing values into the function module, and the function module can modify these values, which are then reflected in the calling program or function module.
TABLES PARAMETER:
These parameters allow you to pass internal tables into the function module, and the function module can process the data within these tables.
EXCEPTION:
In SAP ABAP (Advanced Business Application Programming), exceptions in function modules are used to handle errors or exceptional situations that may arise during the execution of the function module. Exception handling is crucial for identifying and addressing unexpected issues in the program's execution.
Source Code:
In SAP ABAP, the source code of a function module contains the logic and processing instructions that are executed when the function module is called.
Next.. How to create Function module in sap ?