‎2007 Jan 12 5:52 AM
Hi All,
I need the Simple definition about the function modules and uses with examples.
thanks in advance.
‎2007 Jan 12 6:12 AM
Hi vijay,
Chck this.
http://help.sap.com/saphelp_erp2005vp/helpdata/en/2a/f9ff95493111d182b70000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/77/62a43c24358d15e10000000a114084/frameset.htm
https://forums.sdn.sap.com/click.jspa?searchID=711835&messageID=2916699
Regards,
-Priyanka.
‎2007 Jan 12 6:12 AM
Hi vijay,
Chck this.
http://help.sap.com/saphelp_erp2005vp/helpdata/en/2a/f9ff95493111d182b70000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/77/62a43c24358d15e10000000a114084/frameset.htm
https://forums.sdn.sap.com/click.jspa?searchID=711835&messageID=2916699
Regards,
-Priyanka.
‎2007 Jan 12 6:22 AM
Hi,
Check this definition from the help.
Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program.
Function groups act as containers for function modules that logically belong together.
Function modules allow you to encapsulate and reuse global functions in the R/3 System.
Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder.
Thanks,
Naren
‎2007 Jan 12 6:25 AM
Hi vijay,
Function modules are ABAP routines that are administered in a central function library. They apply across applications and are available throughout the system. You must assign function modules to a function pool that is called a function group. A function group is nothing but a container for the function modules. Now create a function group and then a function module, which you can use for the next exercise steps.
Create a Function Group:
Create Global Data:
Within the function group you can declare global data. All function modules of this function group share this global data.
1. In the Object Selection window open the directory tree Includes and double-click on LFG_TutorialTOP.
2. Choose Create « Change (
STRG+F1 ) and enter the following data declarations in the tool area:
TABLES spfli.
DATA spfli_workarea LIKE spfli.
3. Check (
STRGF2 ) and activate ( STRGF3 ) the include file.
Create a Function Module:
Create a function module that reads data from table SPFLI .
1. If you are not yet in the Object Navigator, choose from the SAP Menu Overview à Object Navigator and display the function group
2. FG_Tutorial . In the Object selection window, use the right mouse button to select function group
3. FG_Tutorial , and choose Create à Function module. Enter as function module name
4. XX_RFC_READ_SPFLI and replace XX with the initials of your name. Enter a short description and choose Save.
The system lists the function module in the object list in a new directory Function modules, and displays it on the right side in the Function Builder.
5. Select the Attributes tab and under Processing type choose Remote-enabled module.
6. Select the Import tab and enter in the appropriate columns the names of the import parameters:
7. carrid with reference type like spfli-carrid and connid with reference type like spfli-connid . For each parameter set the Pass value flag. Select the Export tab and enter in the appropriate columns the names of the export parameters:
8. ex_spfli with reference type like spfli and sys with reference type like sy-sysid . For each parameter set the Pass value flag. Select the Exceptions tab and enter the exception
9. invalid_data . Select the Source code tab.
The system copies the entries you made in the other tabs and creates a source text.
10. Complete the function module with the actual flight data retrieval.
Compare your function with the model solution.
11. Save the function module (
12. STRG+S ). When the note on remote-enabled function modules appears, choose Continue. Check the function for errors (
STRGF2 ) and then activate it ( STRGF3 ).
Test the Function Module:
To call a FM in program
CALL FUNCTION 'function module name'.
‎2007 Jan 12 6:32 AM
Have a look at below links:
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/frameset.htm">Function Modules</a>
<a href="http://www.erpgenie.com/abap/functions.htm">List of Function modules</a>
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
‎2007 Jan 16 9:38 AM
Hi,
Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
Function groups are containers for function modules.
Just have a look at these links:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db988735c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/9f/db988735c111d1829f0000e829fbfe/frameset.htm</a>
Creating Function Modules:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/db988735c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/9f/db988735c111d1829f0000e829fbfe/frameset.htm</a>
Calling Function modules:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/db/9987bfc3cf11d194ad00a0c94260a5/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/db/9987bfc3cf11d194ad00a0c94260a5/frameset.htm</a>
Some Function Modules:
<a href="http://www.erpgenie.com/abap/functions.htm">http://www.erpgenie.com/abap/functions.htm</a>
Regards,
Gunasree.