SlideShare a Scribd company logo
User Exits
Dec-2008 User Exits |
Objectives
• The participants will be able to:
– Discuss the procedure of modifying SAP Standard
program through procedure SSCR (SAP Software
Change Registration).
– Locate, code and implement Function exits.
– Differentiate between CALL FUNCTION and CALL
CUSTOMER-FUNCTION statements.
– Identify Projects and Enhancements and use the
transactions CMOD and SMOD.
Dec-2008 User Exits | 2
Overview
Dec-2008 User Exits | 3
If you try to change the SAP
program “SAPMF02K”, you will
be prompted to enter the access
key for that object.
 It mandatory for users to register all manual changes to SAP source coding and
SAP Dictionary objects through a procedure called SSCR.
SAP Modification
Dec-2008 User Exits | 4
 After you enter the appropriate access key, you will be able to modify a SAP
standard object. You should avoid making repairs to SAP objects/code.
Obtaining Object Access Key
Dec-2008 User Exits | 5
 To obtain the access key for changing a SAP
Standard object, either run transaction OSS1 or
go to the site www.service.sap.com.
Obtaining Object Access Key (Contd.)
Dec-2008 User Exits | 6
 Go to the registration tab
 Go to Register Objects
Obtaining Object Access Key (Contd.)
Dec-2008 User Exits | 7
 Select your server by matching
installation number.
 Provide the Object name, SAP
Release and click on the
‘Register’ tab.
 The Registration Key for the
Object will be displayed.
Different Enhancement Techniques
Dec-2008 User Exits | 8
SAP 3 Tier Architecture
PRESENTATION :
Field Exits (SAP would no longer support Field Exits)
Screen Exits
Menu Exits
APPLICATION:
Program exits ( Function Exits, BAdis, Business
Transaction Events, Substitution Exits )
DATABASE
Append Structure
Information on existing User-Exits
Dec-2008 User Exits | 9
 Using transaction SPRO, one can information along with detailed documentation
on the Exits available for areas of concern.
Function-Exits
Dec-2008 User Exits | 10
*-------------------------------
---*
* include zxf05u01.
*
*-------------------------------
---*
This INCLUDE
program is where you
will write the
customer-specific
code.
call customer-function
“001”...
function
exit_sapmf02k_001.
include zxf05u01.
endfunction.
SAP Original Code
“SAPMF02K”
Function Module INCLUDE Program
This INCLUDE program
will not be overwritten
with an SAP upgrade
because it is not SAP
original code.
Call Customer-Function Versus Call
Function
Dec-2008 User Exits | 11
The CALL CUSTOMER-FUNCTION
statement will only execute the
function module if the module
is activated.
call function ‘EXIT_SAPMF02K_001’
 Both of these CALL statements refer
to the function module
“EXIT_SAPMF02K_001”.
Business Case Scenario
Dec-2008 User Exits | 12
UPDATE LOG
Vendor #
Vendor name
When the user updates a vendor record, you want to
insert a record into an update log that contains the
vendor number and name of the updated record.
Steps to Coding a Function-Exit
Dec-2008 User Exits | 13
1. Locate Function-Exit(s)
2. Go to Function Module
3. Create INCLUDE Program
4. Code in INCLUDE Program
5. Activate Function-Exit
Locate Function-Exit(s)
Dec-2008 User Exits | 14
Locate Function-Exit(s)
Dec-2008 User Exits | 15
In program “SAPMF02K”, search
for the string “call customer-
function” in the main program to
find all of the function-exit(s) in
the program.
Locate Function-Exit(s)
Dec-2008 User Exits | 16
Double-click anywhere on
the call customer-function
“001” statement to go to that
line in the SAP program.
In program “SAPMF02K”, there is
only one function-exit at line 83 of
“MF02KFEX”.
Go to Function Module
Dec-2008 User Exits | 17
Double-click on ‘001’ of the
CALL CUSTOMER-FUNCTION
“001” statement in the SAP
program to go to the function
module “EXIT_SAPMF02K_001”.
Create INCLUDE Program
Dec-2008 User Exits | 18
Double-click on the INCLUDE
ZXF05U01 statement in the
function module to create the
INCLUDE program.
Code in INCLUDE Program
*------------------------------
* INCLUDE ZXF05U01
*------------------------------
if sy-uname = ‘SANGRAMC’.
endif.
Dec-2008 User Exits | 19
 Write code in the include program.
 Whatever logic you add here will affect all
SAP standard transaction where this
particular User Exit is being called.
 Put all your code within the username
check, while you are at the middle of the
user exit development. So, that your logic
in the exit (which is incomplete now) does
not affect others users in the system.
 At the end of the development, when you
have tested that your logic is correct,
remove the username check. So, the
additional logic (tested & verified now) is
now triggered for all users in the system.
Activating Function-Exit
Dec-2008 User Exits | 20
X
X
PROJECT 1
(can be activated/deactivated)
Enhancement
1
Enhancement
2
Function
Exit
Screen
Exit
Function
Exit
PROJECT 2
(can be activated/deactivated)
Enhancement
3
Function
Exit
 You do not actually activate a single function-exit; instead, you activate a
PROJECT that will include your user-exit(s).
User-Exit Transactions
Dec-2008 User Exits | 21
 CMOD : This transaction allows you to create a PROJECT by identifying its
ENHANCEMENT(S). After determining all of the ENHANCEMENTS that are part
of the PROJECT, you will have to activate the PROJECT. You will still need to code
your user-exit; therefore, you may want to wait until this step is completed before
activating the PROJECT.
 SMOD : This transaction allows you to create an ENHANCEMENT, which you will
include in a PROJECT, by identifying its COMPONENT(S). In the case where SAP
has already created an ENHANCEMENT for its pre-defined user-exits, you will not
need to use transaction SMOD; instead, you should just use transaction CMOD.
Transaction CMOD
Dec-2008 User Exits | 22
In transaction CMOD, type in the
name of your project and press
the CREATE pushbutton.
Transaction CMOD
Dec-2008 User Exits | 23
Once you SAVE your project,
you can add as many
enhancements as you want by
pressing the SAP
enhancements pushbutton.
Transaction CMOD
Dec-2008 User Exits | 24
Add the enhancements you
want included in
the project.
Transaction CMOD
Dec-2008 User Exits | 25
After saving your project,
you need to ACTIVATE it.
Transaction SMOD
Dec-2008 User Exits | 26
With the name of the enhancement,
you can display its components.
Transaction SMOD
Dec-2008 User Exits | 27
In the case of enhancement
“SAPMF02K”, there is only one
user-exit – a function-exit using
the function module
“EXIT_SAPMF02K_001”.
Additional Information
28 Dec-2008User Exits |
 You can use table MODACT to find the Project an Enhancement is included in.
 You can use table MODSAP to find the Enhancement for a Function Exit.
Component or Function Exit
Summary
• You should avoid making
modifications/repairs to SAP objects/code
whenever possible.
• It mandatory for users to register all manual
changes to SAP source coding and SAP
Dictionary objects through a procedure called
SSCR.
• To obtain the access key for changing a SAP
Standard object, either run transaction OSS1
or go to the site www.service.sap.com.
Dec-2008 User Exits | 29
Questions
• How do you obtain access key for changing a
SAP standard object ?
• What are the steps for coding a Function
Exits ?
• What does CMOD and SMOD do ?
Dec-2008 User Exits | 30

More Related Content

PDF
Bapi step-by-step
PPT
Ab1011 module pool programming
PPTX
SAP Adobe forms
PPTX
SAP Fiori ppt
DOC
Adding custom fields to the fi report fbl5 n using bt es
PPT
User exit training
PPTX
Sap abap
DOC
1000 solved questions
Bapi step-by-step
Ab1011 module pool programming
SAP Adobe forms
SAP Fiori ppt
Adding custom fields to the fi report fbl5 n using bt es
User exit training
Sap abap
1000 solved questions

What's hot (20)

PDF
Abap reports
DOCX
Badis
PDF
Ooabap notes with_programs
PPTX
Sap User Exit for Functional Consultant
PDF
S4 HANA Business Partner Configuration@Ganesh Tarlana
DOC
Badi document
PDF
Introducing enhancement framework.doc
DOC
Important tables for sap sd
PPTX
SAP Modularization techniques
PDF
VOFM Routine
PDF
Sap Abap Reports
PPT
abap list viewer (alv)
PPTX
SAP BADI Implementation Learning for Functional Consultant
PPT
Module pool programming
PDF
Guide to Configure Custom SD Output Types in S/4HANA Using BRF+
DOCX
Field symbols
DOC
What is ticketing tool in sap
PPT
08.Abap Dialog Programming Overview
PDF
PDF
Using idoc method in lsmw
Abap reports
Badis
Ooabap notes with_programs
Sap User Exit for Functional Consultant
S4 HANA Business Partner Configuration@Ganesh Tarlana
Badi document
Introducing enhancement framework.doc
Important tables for sap sd
SAP Modularization techniques
VOFM Routine
Sap Abap Reports
abap list viewer (alv)
SAP BADI Implementation Learning for Functional Consultant
Module pool programming
Guide to Configure Custom SD Output Types in S/4HANA Using BRF+
Field symbols
What is ticketing tool in sap
08.Abap Dialog Programming Overview
Using idoc method in lsmw
Ad

Viewers also liked (15)

PDF
Smartforms interview questions with answers
PPT
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
DOC
SAP ABAP Material
DOCX
Prashant sap abap developer
PPTX
Dot Net 串接 SAP
PDF
022006 zaidi badi
PDF
Dr John Dee - Communications With Spirits - Free Ebook
PPT
Chapter 08 abap dictionary objects views1
PDF
Enhancement framework the new way to enhance your abap systems
DOCX
Creation of a web service in sap
PDF
Step by Step guide for creating first ABAP report in SAP
PPS
SAP ABAP web services creation.
PPT
Yash technologies interview questions and answers
DOC
Scenario on business transaction events
PDF
Beginner’s guide to sap abap 1
Smartforms interview questions with answers
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Material
Prashant sap abap developer
Dot Net 串接 SAP
022006 zaidi badi
Dr John Dee - Communications With Spirits - Free Ebook
Chapter 08 abap dictionary objects views1
Enhancement framework the new way to enhance your abap systems
Creation of a web service in sap
Step by Step guide for creating first ABAP report in SAP
SAP ABAP web services creation.
Yash technologies interview questions and answers
Scenario on business transaction events
Beginner’s guide to sap abap 1
Ad

Similar to Chapter 01 user exits (20)

DOC
User exits
PDF
CATS Approval.pdf
PDF
Variables in sap bi
PDF
BADI IMPLEMENTATION.pdf
PDF
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
PDF
ERP Magazine April 2018 Issue 1
PDF
Creating attachments to work items or to user decisions in workflows
PPS
SAP PM and xMII
PDF
Acumatica ERP 4.1 Customization Guide
PDF
SAP AC020 - Investment Management
PDF
sap fico implementation project phase pd
PDF
Panelsaw sawteq-b-400-e
PDF
Architecture and Analytical Study of Magento
PDF
Vb6 ch.6-3 cci
PDF
ControlSystemsAutogenBrochure
PDF
Cube remodelling
PPTX
Accel_Series_2022Spring_En.pptx
PDF
In Mind Cloud - Product Release - 1904
PDF
How to extend an outbound i doc
PPTX
11 Enhancements & Modifications.pptx
User exits
CATS Approval.pdf
Variables in sap bi
BADI IMPLEMENTATION.pdf
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 Issue 1
Creating attachments to work items or to user decisions in workflows
SAP PM and xMII
Acumatica ERP 4.1 Customization Guide
SAP AC020 - Investment Management
sap fico implementation project phase pd
Panelsaw sawteq-b-400-e
Architecture and Analytical Study of Magento
Vb6 ch.6-3 cci
ControlSystemsAutogenBrochure
Cube remodelling
Accel_Series_2022Spring_En.pptx
In Mind Cloud - Product Release - 1904
How to extend an outbound i doc
11 Enhancements & Modifications.pptx

More from Kranthi Kumar (20)

PDF
Exercise in alv
PDF
Dynamic binding
PDF
Data binding
PDF
Creating simple comp
PDF
Creating messages
PDF
Creating a comp
PDF
Controllers and context programming
PDF
Context at design
PDF
Binding,context mapping,navigation exercise
PDF
Alv for web
PDF
Web(abap introduction)
DOC
Abap faq
PDF
Sap abap material
PDF
Crm technical
PDF
control techniques
PPT
Chapter 07 debugging sap scripts
PPT
Chapter 06 printing sap script forms
PPT
Chapter 05 sap script - configuration
PPT
Chapter 04 sap script - output program
PPT
Chapter 02 sap script forms
Exercise in alv
Dynamic binding
Data binding
Creating simple comp
Creating messages
Creating a comp
Controllers and context programming
Context at design
Binding,context mapping,navigation exercise
Alv for web
Web(abap introduction)
Abap faq
Sap abap material
Crm technical
control techniques
Chapter 07 debugging sap scripts
Chapter 06 printing sap script forms
Chapter 05 sap script - configuration
Chapter 04 sap script - output program
Chapter 02 sap script forms

Chapter 01 user exits

  • 2. Objectives • The participants will be able to: – Discuss the procedure of modifying SAP Standard program through procedure SSCR (SAP Software Change Registration). – Locate, code and implement Function exits. – Differentiate between CALL FUNCTION and CALL CUSTOMER-FUNCTION statements. – Identify Projects and Enhancements and use the transactions CMOD and SMOD. Dec-2008 User Exits | 2
  • 3. Overview Dec-2008 User Exits | 3 If you try to change the SAP program “SAPMF02K”, you will be prompted to enter the access key for that object.  It mandatory for users to register all manual changes to SAP source coding and SAP Dictionary objects through a procedure called SSCR.
  • 4. SAP Modification Dec-2008 User Exits | 4  After you enter the appropriate access key, you will be able to modify a SAP standard object. You should avoid making repairs to SAP objects/code.
  • 5. Obtaining Object Access Key Dec-2008 User Exits | 5  To obtain the access key for changing a SAP Standard object, either run transaction OSS1 or go to the site www.service.sap.com.
  • 6. Obtaining Object Access Key (Contd.) Dec-2008 User Exits | 6  Go to the registration tab  Go to Register Objects
  • 7. Obtaining Object Access Key (Contd.) Dec-2008 User Exits | 7  Select your server by matching installation number.  Provide the Object name, SAP Release and click on the ‘Register’ tab.  The Registration Key for the Object will be displayed.
  • 8. Different Enhancement Techniques Dec-2008 User Exits | 8 SAP 3 Tier Architecture PRESENTATION : Field Exits (SAP would no longer support Field Exits) Screen Exits Menu Exits APPLICATION: Program exits ( Function Exits, BAdis, Business Transaction Events, Substitution Exits ) DATABASE Append Structure
  • 9. Information on existing User-Exits Dec-2008 User Exits | 9  Using transaction SPRO, one can information along with detailed documentation on the Exits available for areas of concern.
  • 10. Function-Exits Dec-2008 User Exits | 10 *------------------------------- ---* * include zxf05u01. * *------------------------------- ---* This INCLUDE program is where you will write the customer-specific code. call customer-function “001”... function exit_sapmf02k_001. include zxf05u01. endfunction. SAP Original Code “SAPMF02K” Function Module INCLUDE Program This INCLUDE program will not be overwritten with an SAP upgrade because it is not SAP original code.
  • 11. Call Customer-Function Versus Call Function Dec-2008 User Exits | 11 The CALL CUSTOMER-FUNCTION statement will only execute the function module if the module is activated. call function ‘EXIT_SAPMF02K_001’  Both of these CALL statements refer to the function module “EXIT_SAPMF02K_001”.
  • 12. Business Case Scenario Dec-2008 User Exits | 12 UPDATE LOG Vendor # Vendor name When the user updates a vendor record, you want to insert a record into an update log that contains the vendor number and name of the updated record.
  • 13. Steps to Coding a Function-Exit Dec-2008 User Exits | 13 1. Locate Function-Exit(s) 2. Go to Function Module 3. Create INCLUDE Program 4. Code in INCLUDE Program 5. Activate Function-Exit
  • 15. Locate Function-Exit(s) Dec-2008 User Exits | 15 In program “SAPMF02K”, search for the string “call customer- function” in the main program to find all of the function-exit(s) in the program.
  • 16. Locate Function-Exit(s) Dec-2008 User Exits | 16 Double-click anywhere on the call customer-function “001” statement to go to that line in the SAP program. In program “SAPMF02K”, there is only one function-exit at line 83 of “MF02KFEX”.
  • 17. Go to Function Module Dec-2008 User Exits | 17 Double-click on ‘001’ of the CALL CUSTOMER-FUNCTION “001” statement in the SAP program to go to the function module “EXIT_SAPMF02K_001”.
  • 18. Create INCLUDE Program Dec-2008 User Exits | 18 Double-click on the INCLUDE ZXF05U01 statement in the function module to create the INCLUDE program.
  • 19. Code in INCLUDE Program *------------------------------ * INCLUDE ZXF05U01 *------------------------------ if sy-uname = ‘SANGRAMC’. endif. Dec-2008 User Exits | 19  Write code in the include program.  Whatever logic you add here will affect all SAP standard transaction where this particular User Exit is being called.  Put all your code within the username check, while you are at the middle of the user exit development. So, that your logic in the exit (which is incomplete now) does not affect others users in the system.  At the end of the development, when you have tested that your logic is correct, remove the username check. So, the additional logic (tested & verified now) is now triggered for all users in the system.
  • 20. Activating Function-Exit Dec-2008 User Exits | 20 X X PROJECT 1 (can be activated/deactivated) Enhancement 1 Enhancement 2 Function Exit Screen Exit Function Exit PROJECT 2 (can be activated/deactivated) Enhancement 3 Function Exit  You do not actually activate a single function-exit; instead, you activate a PROJECT that will include your user-exit(s).
  • 21. User-Exit Transactions Dec-2008 User Exits | 21  CMOD : This transaction allows you to create a PROJECT by identifying its ENHANCEMENT(S). After determining all of the ENHANCEMENTS that are part of the PROJECT, you will have to activate the PROJECT. You will still need to code your user-exit; therefore, you may want to wait until this step is completed before activating the PROJECT.  SMOD : This transaction allows you to create an ENHANCEMENT, which you will include in a PROJECT, by identifying its COMPONENT(S). In the case where SAP has already created an ENHANCEMENT for its pre-defined user-exits, you will not need to use transaction SMOD; instead, you should just use transaction CMOD.
  • 22. Transaction CMOD Dec-2008 User Exits | 22 In transaction CMOD, type in the name of your project and press the CREATE pushbutton.
  • 23. Transaction CMOD Dec-2008 User Exits | 23 Once you SAVE your project, you can add as many enhancements as you want by pressing the SAP enhancements pushbutton.
  • 24. Transaction CMOD Dec-2008 User Exits | 24 Add the enhancements you want included in the project.
  • 25. Transaction CMOD Dec-2008 User Exits | 25 After saving your project, you need to ACTIVATE it.
  • 26. Transaction SMOD Dec-2008 User Exits | 26 With the name of the enhancement, you can display its components.
  • 27. Transaction SMOD Dec-2008 User Exits | 27 In the case of enhancement “SAPMF02K”, there is only one user-exit – a function-exit using the function module “EXIT_SAPMF02K_001”.
  • 28. Additional Information 28 Dec-2008User Exits |  You can use table MODACT to find the Project an Enhancement is included in.  You can use table MODSAP to find the Enhancement for a Function Exit. Component or Function Exit
  • 29. Summary • You should avoid making modifications/repairs to SAP objects/code whenever possible. • It mandatory for users to register all manual changes to SAP source coding and SAP Dictionary objects through a procedure called SSCR. • To obtain the access key for changing a SAP Standard object, either run transaction OSS1 or go to the site www.service.sap.com. Dec-2008 User Exits | 29
  • 30. Questions • How do you obtain access key for changing a SAP standard object ? • What are the steps for coding a Function Exits ? • What does CMOD and SMOD do ? Dec-2008 User Exits | 30

Editor's Notes

  • #4: In certain situations, you may notice that the SAP Standard object does not exactly match the requirement of your client. So, you may feel to modify the SAP objects/code to match the requirement. But, this is not a good way of achieving the results. You should avoid making modifications/repairs to SAP objects/code whenever possible. There are other rational ways to incorporate your additional requirements to SAP standard code. The main reason for which you should refrain from altering SAP standard object is, any modified SAP code will be overwritten with upgraded versions of SAP. Because of this problem, SAP has made it mandatory for users to register all manual changes to SAP source coding and SAP Dictionary objects through a procedure called SSCR (SAP Software Change Registration). Basically, SSCR involves you, the user, obtaining an access key from SAP to make changes to original SAP code. If you tried to change the SAP program “SAPMF02K”, you would be prompted to enter the access key for that object.
  • #5: After you enter the appropriate access key, you will be able to modify this program. Note: Any changes you make to the program will be overwritten when the next SAP upgrade is installed.
  • #6: You should avoid making modifications/repairs to SAP objects/code whenever possible. However if it is absolutely necessary to change a SAP standard program with the access key, then follow the below mentioned procedure. Get the Installation No. of your SAP System and remember it. (Go to “System -> Status” tab in the menu bar of your SAP screen) To obtain the access key for changing a SAP Standard object, either run transaction OSS1 or go to the site www.service.sap.com. Give the SAPNet User ID and Password to logon to the OSS.
  • #7: Go to the registration tab. Go to Register Objects.
  • #8: Select your server by matching installation number. Provide the Object name, SAP Release and click on the ‘Register’ tab. The Registration Key for the Object will be displayed, use this key when you are prompted for the object access key while attempting to change a SAP Standard object. You can view your registration by selecting “Objects registered by Me” tab.
  • #9: As per SAP’s 3 Tier Architecture, at the Presentation layer you had Field Exits, Screen Exits and Menu Exits. At the Application layer you had Program exits, at the Database layer you could Append structures to the existing SAP structures. Function-Exits: These are the function modules created by SAP and activated by the customer (non-activated function-exits do not slow down the transaction). Menu-Exits: These allow the customer to activate menu items and assign additional functionality to them. Screen-Exits: These allow the customer to add additional fields to a screen and make entries.
  • #10: Using transaction SPRO, one can information along with detailed documentation on the Exits available for areas of concern. This helps in using the proper exit and the relevant program to meet the requirement.
  • #11: The concept of a function-exit involves various points in original SAP programs that have calls to specific function modules (EXIT_<program name>_xxx). <program name>: name of program that the function module is called from xxx: unique number for each function-exit within a particular program These function modules only contain an “INCLUDE” statement. It is in these INCLUDES that you will code the customer-specific program that will be called from an original SAP program but will not be overwritten with SAP upgrades.
  • #12: If you notice from the previous slide, the call to the function module for a function-exit is not the typical CALL FUNCTION “EXIT_SAPMF02K_001”; instead, it is a CALL CUSTOMER-FUNCTION ‘001'. These two statements are similar in that they both call the same function module (EXIT_SAPMF02K_001). The difference between the two calls is that the “CALL CUSTOMER-FUNCTION” statement will only execute the function module if the function module is activated (activating user-exits is covered in later slides). With the “CALL FUNCTION” statement, the system will try to execute the code in the function module whether it is active or not. The reason that SAP uses the CALL CUSTOMER-FUNCTION in its original code is that resources are not wasted if the customer has not utilized this particular user-exit functionality.
  • #13: As an example, assume that you want to create a log when a vendor record is updated. The change vendor transaction is “FK02”. Using the “System->Status” menu path in this transaction, you can determine that the program is “SAPMF02K”.
  • #14: Steps to Coding a Function-Exit Locate Function-Exit in SAP Program (in our example, program “SAPMF02K”). Go to Function Module associated with that Function-Exit Create INCLUDE Program that is used in the Function Module Code in the INCLUDE Program (in our example, the code would insert a record into the update log) Activate the Function-Exit Using our example with program “SAPMF02K”, these steps are covered in detail in the following slides.
  • #15: Using transaction “SE38” (ABAP Editor), display the program “SAPMF02K”.
  • #16: Search for the string “call customer-function” in the main program to find the function-exit(s) in the program.
  • #17: If the string “call customer-function” is found, you will be able to determine where and how many function-exits there are in the program. In program “SAPMF02K”, there is only one function-exit. Once your search has found a function-exit, you can go to it by double-clicking on the specific function module call statement or the line number (in this example, “100”). By doing this, you will go to the area of the main program that contains the call statement (in this example, program “MF02KFEX”). Note:This method may not find all the function exits in the program. If a function exits occurs in a function module “called” from the program, this method will not find it. The best way to find User Exits available for a particular transaction is to run the Transaction in the Runtime Analysis tool (SE30). Then, in the analysis results screen ( where all program, function and method calls during the runtime of the transaction are displayed) search by the keyword ‘EXIT_’. Then Navigate to each Function Exit call by clicking the source code button after placing the cursor on it. From the Function Exit call, double click to go into the Function Exit. Then using table MODSAP find the enhancement related to it.
  • #18: Once you are in the SAP program at the spot of the function-exit, you can go to the actual function module (EXIT_SAPMF02K_001) by double-clicking on ‘001’ of the “CALL CUSTOMER-FUNCTION” statement. Note: An SAP program can have more than one function-exit. The difficulty comes in determining when these function-exits get executed in the course of the program. For our example, assume that you know the above function-exit occurs when a vendor record is being saved (updated or inserted).
  • #19: Notice that the only code in this function module is the INCLUDE statement. Double-click on the “INCLUDE” statement to create the INCLUDE program. When prompted that “Include ZXF05U01 does not exist. Do you want to create the object?”, press the YES pushbutton. When prompted with the name of the INCLUDE program, press the green checkmark button. For the attributes of the INCLUDE program, you will need to enter a title, the program type (in this case, “I” for include), and an application.
  • #20: It is in this INCLUDE program that you will put your specific code (in our example, the code to insert a record in an update log). Remember, because the SAP program “SAPMF02K” uses the “CALL CUSTOMER-FUNCTION” statement, the code in this INCLUDE program will not be executed until the function-exit is activated. Notice the use of the “IF SY-UNAME = ‘SANGRAMC’ ... ENDIF” statements. This logic is used for testing your function-exit so that the only time the code within the “IF” statement is executed is when you are the user executing the appropriate transaction (in this example, transaction “FK02”).
  • #21: You do not actually activate a single function-exit; instead, you activate a PROJECT that will include your user-exit(s). To activate a PROJECT, you use transaction CMOD (menu path: Tools-> ABAP workbench-> Environment-> Enhancements-> Project management). PROJECT - The highest level in the modification process. Projects are simply used to group together ENHANCEMENTS. It's purpose is to enable the modifier to activate a number of different enhancements that are related and to as ensure that other ENHANCEMENTS are not undesirably activated. ENHANCEMENT - These are used to group together a collection of COMPONENTS that are inter-related. The naming convention for these usually corresponds to the program(s) in which the user-exits exist Note:One SAP program may have more than one user-exit; each of these exits will usually be a part of the same ENHANCEMENT. [relationship with PROJECT = one to zero or one to one] COMPONENTS - These are the actual modifications that may be used in the SAP system to help customize the system. This is the lowest level of the modification process and includes the various categories of user-exits. [relationship with ENHANCEMENT = one to zero or one to one]
  • #22: CMOD - This transaction allows you to create a PROJECT by identifying its ENHANCEMENT(S). After determining all of the ENHANCEMENTS that are part the PROJECT, you will have to activate the PROJECT. You will still need to code your user-exit; therefore, you may want to wait until this step is completed before activating the PROJECT. SMOD - This transaction allows you to create an ENHANCEMENT, which you will include in a PROJECT, by identifying its COMPONENT(S). In the case where SAP has already created an ENHANCEMENT for its pre-defined user-exits, you will not need to use transaction SMOD; instead, you should just use transaction CMOD. You determine which enhancements should be included in a particular project using transaction CMOD. SAP comes with standard enhancements that include various user-exits. However, if these user-exits do not involve a transaction activity that you want to modify, you will have to create your own user-exit and enhancement using transaction SMOD. Note:That to create your own function-exit, you will have to modify original SAP code to include the “CALL CUSTOMER-FUNCTION” statement that will execute your customer-specific code (remember: this code will be overwritten with an SAP upgrade).
  • #23: In order for our example function-exit to execute, we need to activate it. Because we do not activate individual user-exits, we need to create a project to activate using transaction CMOD. Another way to find components of an enhancement is to use the transaction SMOD (Menu path: Tools-> ABAP workbench-> Utilities-> Enhancements-> Project Management). Note:Once you are in transaction CMOD, form the initial screen (as above) you can display the relevant documentation by selecting the Documentation radio button.
  • #24: Next, you enter a short description and save the project. Then, you need to add enhancements to the project (press the “Enhancement assignments’’ pushbutton).
  • #25: From the enhancements screen, you enter the appropriate enhancements (you can use the serachhelp to find particular enhancement). Once you add the enhancements you want, you must save the project. After saving the project, you should green arrow back to the initial CMOD screen so that you can activate the project.
  • #26: You must activate the project on the initial CMOD screen. You can always go back into transaction CMOD to activate/deactivate or delete a particular project. After activating the project for our example, we can execute transaction “FK02” and the code we have written in the function-exit INCLUDE program will be executed.
  • #27: Another way to find components of an enhancement is to use the transaction SMOD (Menu path: Tools-> ABAP workbench-> Utilities-> Enhancements-> Definition). Once you know the name of the enhancement, go into transaction SMOD and display the components of the appropriate enhancement.
  • #28: As you can see, there is only one component to this enhancement, the function module “EXIT_SAPMF02K_001”. You will still need to determine where this function module is called from within the main program, but notice that the short text does give you an indication. Once you know the name of the function module, you can display it using the Function Library (transaction SE37) and proceed to the appropriate INCLUDE area where you will put the customer-specific code. Again, you must follow all the steps to create a project, include the enhancement, and activate it.