Application Development 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: 

Function Groups

naveen_inuganti2
Active Contributor
0 Kudos

Hi....

Any body send me what are the uses of the include programs generates function groups while creating...?

And what is the Difference between those two?

And in which cases we have to go for change them?

Thank you,

Naveen Inuganti.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Include Programs

Include programs are global R/3 Repository objects. They are solely for modularizing source code, and have no parameter interface.

They have the following functions:

Library: Include programs allow you to use the same source code in different programs. For example, this can be useful if you have lengthy data declarations that you want to use in different programs.

Order. Include programs allow you to manage complex programs in an orderly way. Function groups and module pools use include programs to store parts of the program that belong together. The ABAP Workbench supports you extensively when you create such complex programs by creating the include programs automatically and by assigning them unique names. A special include is the TOP include of a program. If you name it according to the naming convention, it is always included in program navigation and in the syntax check.

Creating Your Own Include Programs

If you create an include program yourself, you must assign it the type I in its program attributes. You can also create or change an include program by double-clicking on the name of the program after the INCLUDE statement in your ABAP program. If the program exists, the ABAP Workbench navigates to it. If it does not exist, the system creates it for you.

An include program cannot run independently, but must be built into other programs. Include programs can contain other includes.

The only restrictions for writing the source code of include programs are:

Include programs cannot call themselves.

Include programs must contain complete statements.

You must ensure that the statements of your include program fit logically into the source code of the programs from which it is called. Choosing Check while editing an include program in the ABAP Editor is normally not sufficient for this.

se37 funcation group used for funcation module store on sap library.

Function Groups

function group creates two includes.

include lfgidtop.

include lfgiduxx. wher fgid is function group

The first include program-lfgidtop-is known as the top include. Within it you can place global data definitions. These are data definitions that are global to all function modules within the group.

The second include program-lfgiduxx-is known as the UXX. You are not allowed to modify the UXX. The system will automatically place an include statement in the UXX for each function module you create in this function group. For the first function module, the statement include lfgidu01 will be inserted into the UXX. When you create a second function module in this group, the system will add a second statement: include lfgidu02.

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). For further information, refer to Organization of External Procedure Calls.

The following diagram shows the structure of a function group: The name of a function group, fgrpcan 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 , the main program and include programs are generated automatically.

The main program SAPLfgrp contains nothing but the INCLUDE statements for the following include programs:

In SAP, it is a function group - instead of function - that is loaded into active memory.

Function ( or function module ) is the one that you call from the program to do things.

A function group contains functionally related function modules, global variables and procedures .

To display / edit function module you use SE37,

To display / edit function group you use SE80 .

Reward If Helpfull,

Naresh.

4 REPLIES 4

Former Member
0 Kudos

Hi

Include Programs

Include programs are global R/3 Repository objects. They are solely for modularizing source code, and have no parameter interface.

They have the following functions:

Library: Include programs allow you to use the same source code in different programs. For example, this can be useful if you have lengthy data declarations that you want to use in different programs.

Order. Include programs allow you to manage complex programs in an orderly way. Function groups and module pools use include programs to store parts of the program that belong together. The ABAP Workbench supports you extensively when you create such complex programs by creating the include programs automatically and by assigning them unique names. A special include is the TOP include of a program. If you name it according to the naming convention, it is always included in program navigation and in the syntax check.

Creating Your Own Include Programs

If you create an include program yourself, you must assign it the type I in its program attributes. You can also create or change an include program by double-clicking on the name of the program after the INCLUDE statement in your ABAP program. If the program exists, the ABAP Workbench navigates to it. If it does not exist, the system creates it for you.

An include program cannot run independently, but must be built into other programs. Include programs can contain other includes.

The only restrictions for writing the source code of include programs are:

Include programs cannot call themselves.

Include programs must contain complete statements.

You must ensure that the statements of your include program fit logically into the source code of the programs from which it is called. Choosing Check while editing an include program in the ABAP Editor is normally not sufficient for this.

se37 funcation group used for funcation module store on sap library.

Function Groups

function group creates two includes.

include lfgidtop.

include lfgiduxx. wher fgid is function group

The first include program-lfgidtop-is known as the top include. Within it you can place global data definitions. These are data definitions that are global to all function modules within the group.

The second include program-lfgiduxx-is known as the UXX. You are not allowed to modify the UXX. The system will automatically place an include statement in the UXX for each function module you create in this function group. For the first function module, the statement include lfgidu01 will be inserted into the UXX. When you create a second function module in this group, the system will add a second statement: include lfgidu02.

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). For further information, refer to Organization of External Procedure Calls.

The following diagram shows the structure of a function group: The name of a function group, fgrpcan 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 , the main program and include programs are generated automatically.

The main program SAPLfgrp contains nothing but the INCLUDE statements for the following include programs:

In SAP, it is a function group - instead of function - that is loaded into active memory.

Function ( or function module ) is the one that you call from the program to do things.

A function group contains functionally related function modules, global variables and procedures .

To display / edit function module you use SE37,

To display / edit function group you use SE80 .

Reward If Helpfull,

Naresh.

Former Member
0 Kudos

Hi,

se37 funcation group used for funcation module store on sap library.

Function Groups

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). For further information, refer to Organization of External Procedure Calls.

The following diagram shows the structure of a function group: The name of a function group, fgrpcan 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 , the main program and include programs are generated automatically.

The main program SAPLfgrp contains nothing but the INCLUDE statements for the following include programs:

キ LfgrpTOP. This contains the FUNCTION-POOL statement (equivalent for a function group of the REPORT or PROGRAMstatement) and global data declarations for the entire function group.

キ LfgrpUXX. This contains further INCLUDEstatements for the include programs LfgrpU01, LfgrpU02,... These includes contain the actual function modules.

キ The include programs LfgrpF01, LfgrpF02,... can contain the coding of subroutines that can be called with internal subroutine calls from all function modules of the group.

The creation of these INCLUDE programs is supported from the ABAP Workbench by forward navigation (for example creation of a subroutine include by double clicking on the name of a subroutine in a PERFORM statement within a function module).

You cannot declare a COMMON PART in a function group. Function groups have their own table work areas (TABLES). Function groups encapsulate data. In this respect, they are a precursor of ABAP Objects (see From Function Groups to Objects ).

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.

Function groups, like executable programs and module pools, can contain screens (selection screens and lists) as components. 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.

In SAP, it is a function group - instead of function - that is loaded into active memory.

Function ( or function module ) is the one that you call from the program to do things.

A function group contains functionally related function modules, global variables and procedures .

To display / edit function module you use SE37,

To display / edit function group you use SE80 .

Regards,

Satish

Former Member
0 Kudos

function group creates two includes with UXX and TOP

UXX contains all function modules names in that function group

TOP contains all global declaration of the function group.

if u want add any global declaration then u can edit TOP include prg

prasanth_kasturi
Active Contributor
0 Kudos

hi

function group creates two includes.

include lfgidtop.

include lfgiduxx. wher fgid is function group

The first include program-lfgidtop-is known as the top include. Within it you can place global data definitions. These are data definitions that are global to all function modules within the group.

The second include program-lfgiduxx-is known as the UXX. You are not allowed to modify the UXX. The system will automatically place an include statement in the UXX for each function module you create in this function group. For the first function module, the statement include lfgidu01 will be inserted into the UXX. When you create a second function module in this group, the system will add a second statement: include lfgidu02. Each time you add a new function module to the group, the system will add a new include statement to the UXX. The number of the include will be 01 for the first function module created within the group, 02 for the second, 03 for the third, and so on.

Within each include mentioned in the UXX is the source code for a function module.

we change them you want to change the functionality of the function module. be careful to deactivate the function module and make the changes otherwise all the fm's in the function group give erraneous results

REWARD IF HELPFUL

PRASANTH