Function Modules SE37
We can have some re-usable piece of codes which is going to return our desired results.
We can also pass some inputs to these re-usable codes and they will return us the
output based on our requirements.
Function Module provides an interface for data exchange. They are basically some
reusable pieces of codes written by the developer for the business requirements.
Function Module is a modularization Technique.
The Function Module will be created from SE37.
These Function Modules requires a container to store them, and these containers are
called Function Group.
Function Group – SE80
Function Group is the container which will be storing Function Modules.
We can create function Group from SE80 (Object Navigator).
A Function group can store up to 99 function Modules.
Every function Group will always have two Includes.
1. TOP
2. UXX
TOP:
TOP is like a global area where you can define anything and this will be accessible for
all the Function Modules which has been stored inside this Function Group.
UXX:
Inside it all the 99 Function Modules will be stored and their names will be replaced
with U01, UO2, U03, ..., U99.
Every Function Modul will have 7 Tabs.
1. Attributes
2. Import
3. Export
4. Changing
5. Tables
6. Exceptions
7. Source Code
Attribute: Attribute always stores the generic data for any database object.
Import: This will be used to take input from the user.
Export: This will be used to return output to the user.
Changing: This can work as both import and export.
Tables: This will be used to send and receive the internal tables.
Exceptions:
Exceptions tab is used to defined the custom exceptions.
Exceptions are unwanted activity happening in the program, so we can handle them.
Source Code: This area is for writing the logic.
Note: Anything declared in TOP include will be available all function modules declared
inside that function group.
Note: Things declared with TYPES keyword can’t store data. They are data types not data
objects. But the things declared with DATA keyword can store data. They are data objects.
Requirement: Create a function module which takes input for Sales Document
number (VBELN in form of parameter) and it returns the data from VBAK table.
Function Module:
Calling Function Module: