Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to expert in function modules

Former Member
0 Likes
809

Hello,

Can anybody tell me how to start working on functional modules...pls provide me a simple documentation.

Thnx in advance.

sreenivas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
728

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

6 REPLIES 6
Read only

Former Member
0 Likes
728
Read only

Former Member
0 Likes
728

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 can’t return.

FMs can raise and handle exceptions while Subroutines can’t.

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 FM’s is done through Parameters like

Import Parameters

Export Parameters

Changing Parameters

Tables Parameters

Exceptions

6) Import Parameters

FM’s import certain values from the main program in order to generate some logical data and these values are exported from main program.

Export Parameters

FM’s 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

FM’s 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

FM’s 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

Read only

Former Member
0 Likes
729

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

Read only

sbhutani1
Contributor
0 Likes
728

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

Read only

Former Member
0 Likes
728

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