Sei sulla pagina 1di 2

A

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

Function modules
A Function module is a sub program which contains a piece of abap code which is used for specific functionality or a task. Function modules contains importing and exporting parameters Function modules also contains Exceptions to raise Error messages Function modules can be tested independently Function modules can be debugged independently Function modules are mainly used for global modularization i.e., once a function module is created it can be used by multiple program throughout SAP.

Function Group:
It is a Group or container of function modules Whenever we create a function module, it must be saved under a group called as function group. Diff Function modules in a function group can share global data.(TOP include prog)

There are two ways to create a function group. 1. From Tcode SE80 2. From Tcode SE37 click on Menu Go to Function groupscreate group

STEPS TO CREATE A FUNCTION GROUP:


Go to SE80 Give the function group name as ZFGRP Press enter Click on yes button Function Group will be created

Whenever a function Group is created, by default a main program and to include programs will be created Ex: SAPL < Function Group Name> Main group Ex: L< function grp name> Top Include prgs L< function grp name> UXX Include prgs

Note: Always the function group should be activated immediately

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 1

B A P&W E B D Y N P R O A B A P @ A R J U N

IGROWSOFT

Components of a Function Module:


1. 2. 3. 4. 5. 6. Import Input to a fmod are called as Importing parameter Export Output from a fmod are called as exporting Changing A variable/wa which acts as Imports/ Export are called as changing parameters Tables Internal tables as Input & output are called as table parameters Exception Are used to catch certain type of errors Source code Contain the ABAP code for a FMOD

Note: TABLES PARAMETERS are OBSOLETE in SAP


They are no longer used in SAP So we create a table type which act as internal table We create table types in SE11 Table types are used in advanced ABAP, i.e., OOABAP. We will discuss in OO ABAP.

ARJUN.LEARN REAL TIME SCENARIOS DONE BY ME

Page 2

Potrebbero piacerti anche