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

function modules and function groups

Former Member
0 Likes
2,446

Hi alll

Can anybody explain me abt function module and function groups...please

Thanks and Regards

vijaya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,002

HI,

Function Group: A Collection of all related Fucntion Modules.

Fucntion Module: A smaall ABAP program which gets some

inputs(through IMPORTing parameters) and process them and

pass the result(through EXPORTing parameters).

Have a look at the follwoing link:

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e9a454211d189710000e8322d00/frameset.htm

For creating funciton group,

Goto SE37 -> GOTO -> FUNCTION GROUP -> CREATE FUNCTION GROUP.

We have to assign function module to this function group.

We can call this function module in SE38 editor by clicking PATTERN button.

Global data in function group can be used by all the function modules in that particular group.

You can create any number of function modules in a function group.

Any error in a single function module of function group, makes the whole function group stop working. So, ensure that there should be no errors in function module we code.

You should activate function group.

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.

Regards,

Ram

6 REPLIES 6
Read only

Former Member
0 Likes
1,003

HI,

Function Group: A Collection of all related Fucntion Modules.

Fucntion Module: A smaall ABAP program which gets some

inputs(through IMPORTing parameters) and process them and

pass the result(through EXPORTing parameters).

Have a look at the follwoing link:

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e9a454211d189710000e8322d00/frameset.htm

For creating funciton group,

Goto SE37 -> GOTO -> FUNCTION GROUP -> CREATE FUNCTION GROUP.

We have to assign function module to this function group.

We can call this function module in SE38 editor by clicking PATTERN button.

Global data in function group can be used by all the function modules in that particular group.

You can create any number of function modules in a function group.

Any error in a single function module of function group, makes the whole function group stop working. So, ensure that there should be no errors in function module we code.

You should activate function group.

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.

Regards,

Ram

Read only

Former Member
0 Likes
1,002

Function module is a piece of reusable code that you can call from any where in your programs.

Function groups contain function modules, that usually give a similar functionality or belong to a specific business object.

You can create these in SE37 transaction code.

Regards,

Ravi

Read only

Former Member
0 Likes
1,002

HI Vijaya,

<b>What is a function group?</b>

A function group is a collection of logically related modules that share global data with each other. All the modules in the group are included in the same main program. When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at runtime. Every function module belongs to a function group.

<b>Function Modules :</b>

1.Function modules are external subroutines with a transparent interface, optional parameters are allowed.

2.Are central Repository objects, and are accessible system-wide. They are present as a set of function in a function module.

3. Are developed and tested using the Function Builder

4. Can be coded to RAISE exceptions

Reward points if this helps.

Manish

Read only

Former Member
0 Likes
1,002

<b>Function groups</b> are containers for function modules. You cannot execute a function group. When you call an function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded).

The name of a function group can be up to 26 characters long. This is used by the system to create the components of the group (main program and corresponding include programs). When you create a function group or

function module in the Function Builder [Ext.] , the main program and include programs are generated automatically.

When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.

The name of the main program is assigned by the system. This is made up of the prefix SAPL followed by the function group name. For example, the main program for function group SXXX is called SAPLSXXX.

The names of the include files begin with L followed by the name of the function group, and conclude with UXX ( or TOP for the TOP include). The TOP include contains global data declarations that are used by all of the function modules in the function group. The other include file within the main program is used to hold the function modules within the group.

You cannot declare a COMMON PART in a function group. Function groups have their own table work areas (TABLES). Function groups encapsulate data.

All of the function modules in a function group can access the global data of the group. For this

reason, you should place all function modules that use the same data in a single function group.

For example, if you have a set of function modules that all use the same internal table, you could

place them in a function group containing the table definition in its global data.

Like executable programs (type 1) and module pools (type M), function groups can contain screens, selection screens, and lists. User input is processed either in dialog modules or in the corresponding event blocks in the main program of the function group. There are special include programs in which you can write this code. In this way, you can use function groups to

encapsulate single screens or screen sequences.

For function module, have a look at

http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm

I hope it helps.

Best Regards,

Vibha

Read only

Former Member
0 Likes
1,002

hi

good

FUNCTION MODULE->

Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together.

FUNCTION GROUP->

Function groups are containers for function modules. You cannot execute a function group. When you call a function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded).

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db992335c111d1829f0000e829fbfe/content.htm

THANKS

MRUTYUN^