‎2006 May 10 6:22 AM
Hello,
Can anybody tell me how to start working on functional modules...pls provide me a simple documentation.
Thnx in advance.
sreenivas.
‎2006 May 10 6:40 AM
Hi Sreeni,
normally u ll be working with existing function modules in SAP.. goto se37, enter any FM, display..u can c the Import parameters,export para, changing para and tables...these are used to communicate with the program from wwhich this FM is called..
to c the working of any FM, execute it via se37, enter the mandatory input parameters n c the result..u may get an idea as to how things work n wat the FM actually does..in some cases u can also c the documentation available for a FM at the upper right corner of the source code...
hope it helps,
pl reward helpful answers..
Regards..
bikash
‎2006 May 10 6:26 AM
‎2006 May 10 6:26 AM
Sreenivasulu M
Go through the following Document
1) ction modules are special external
subroutines stored in a central library.
SAP has provided a good number of pre
defined function modules and also we can
create our own function modules.
We can call any of these function
modules from ABAP/4 programs.
2) We group function modules in to function groups.
The main advantage of grouping function modules into function groups is that, global data of a group can be shared by all function modules in that group.
3) FMs are stored in central library and Subroutines are confined to a particular program.
FMs return values while Subroutines cant return.
FMs can raise and handle exceptions while Subroutines cant.
4) There is a difference in passing parameters to the function modules.
Declaring data as common parts is not possible for function modules.
The calling program and the called function module have different work areas in ABAP/4 dictionary tables.
5) Parameters
Communication with FMs is done through Parameters like
Import Parameters
Export Parameters
Changing Parameters
Tables Parameters
Exceptions
6) Import Parameters
FMs import certain values from the main program in order to generate some logical data and these values are exported from main program.
Export Parameters
FMs can export certain calculated values that are useful to the main program. These exported values are to be imported in the main program.
Changing Parameters
This is a Call by Reference procedure.
7) Table Parameters
FMs can import internal tables and work areas from the main program and the changes are reflected back. This is also done through Call by Reference procedure.
Exceptions
FMs can raise and handle exceptions. Exceptions are such situations where error cant be dealt by the program logic, say like trying to access network resources when the network is not there
😎 Ex.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = C:\TEST.TXT '
FILETYPE = ASC'
IMPORTING
FILESIZE = V_SIZE
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & regards
Sreenivasulu P
Message was edited by: Sreenivasulu Ponnadi
‎2006 May 10 6:36 AM
HI
GOOD
GO THROUGH THE FOLLOWING LINKS
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
THANKS
MRUTYUN
‎2006 May 10 6:40 AM
Hi Sreeni,
normally u ll be working with existing function modules in SAP.. goto se37, enter any FM, display..u can c the Import parameters,export para, changing para and tables...these are used to communicate with the program from wwhich this FM is called..
to c the working of any FM, execute it via se37, enter the mandatory input parameters n c the result..u may get an idea as to how things work n wat the FM actually does..in some cases u can also c the documentation available for a FM at the upper right corner of the source code...
hope it helps,
pl reward helpful answers..
Regards..
bikash
‎2006 May 10 6:40 AM
Hi sreenivasulu,
Follow this link and you will get all most commonly used function modules list with their use. i think this will help you
http://www.sapgenie.com/abap/functions.htm
Regards
Sumit Bhutani
‎2006 May 10 6:57 AM
Hi,
PFA a list of FMs:
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
http://www.geocities.com/victorav15/sapr3/abapfun.html
You can create a function module by passing importing, exporting, changing, tables, exceptions.
The parameters exported by program will be importing parameters to function module. The parameters imported by program will be exporting parameters to function module.
Hope it helps you.
Regards,
Anjali