Prior to creating a new function module, you need to create a function group. Some examples of function groups are given below.
Function Group
Description
V02D
Customer Master: Read/Block
VBAK
Business Object Sales Document
Add one more function module to the same Function Group, goto SE80 and see the result.
ITOB_BAPI_EQ
PM Equipment: BAPIs
STXD
SAPscript program interface 1
Take time to go through each of the function module components. We will examine each of them in this post.
Required transactions are as folows.
Transaction
Description
SE37
Function Builder Initial Screen
SE80
Object Navigator
Run transaction SE37, and in the resulting screen click on the attributes TAB as shown below.
Now you can run transaction SE80, to check the Function Modules, Subroutines and Includes associated with this group. This way you can find out related function modules. For example if a particular function module does not satisfy your requirement, then you can search for a related function module in the same group.
See the figure below.
Now you know how to identify similar function modules in SAP ABAP.
Now Let us see the components that the SAP system created when a function group is created.Create a new function group from transaction SE80 and see all the components associated with it. See the figure below.
As you can see two includes have been created as follows.
LZTEMPTOP LZTEMPUXX
In the TOP include, LZTEMPTOP you can place all the global data definations, these will be global to all the function modules in this group.
The second include program namely LZTEMPUXX should not be modified. The SAP R/3 system automatically places all the includes that you create in this include. When you double click on this include just after creating the Function Group you see the following message in the left pane.
***************************************************************** * THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. * * NEVER CHANGE IT MANUALLY, PLEASE! * *****************************************************************
Important: Every time a function module is added to a Function Group, SAP R/3 will add a new statement to the UXX. The include for the first function module will be 01, the second 02 and so on
Create one more function module, add it to the same group, goto SE80 and see the result, you will notice that the system has generated one more Include named LZTEMPU02. In this case TEMP is specific to the names given for this example.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
No comments:
Post a Comment