Académique Documents
Professionnel Documents
Culture Documents
User Exits
March-2005
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.
March-2005
Overview
It mandatory for users to register all manual changes to SAP source coding and SAP Dictionary objects through a procedure called SSCR.
If you try to change the SAP program SAPMF02K, you will be prompted to enter the access key for that object.
March-2005
SAP Modification
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.
March-2005
March-2005
March-2005
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.
March-2005
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
March-2005
March-2005
Function-Exits
SAP Original Code SAPMF02K call customerfunction 001... Function Module INCLUDE Program
*---------------------------------* * include zxf05u01. * *---------------------------------* This INCLUDE program is where you will write the customer-specific This INCLUDE program will not be overwritten code.
with an SAP upgrade because it is not SAP original code.
10
March-2005
The CALL CUSTOMER-FUNCTION statement will only execute the function module if the module is activated.
11 User Exits | 8.01 March-2005
12
March-2005
1. Locate Function-Exit(s) 2. Go to Function Module 3. Create INCLUDE Program 4. Code in INCLUDE Program
5. Activate Function-Exit
13
March-2005
Locate Function-Exit(s)
14
March-2005
Locate Function-Exit(s)
In program SAPMF02K, search for the string call customerfunction in the main program to find all of the function-exit(s) in the program.
15
March-2005
Locate Function-Exit(s)
Double-click anywhere on the call customer-function 001 statement to go to that line in the SAP program.
16
March-2005
Go to Function Module
Double-click on 001 of the CALL CUSTOMER-FUNCTION 001 statement in the SAP program to go to the function module EXIT_SAPMF02K_001.
17
March-2005
Double-click on the INCLUDE ZXF05U01 statement in the function module to create the INCLUDE program.
18
March-2005
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.
if sy-uname = SANGRAMC.
endif.
19
March-2005
Activating Function-Exit
You do not actually activate a single function-exit; instead, you activate a PROJECT that will include your user-exit(s).
PROJECT 1
(can be activated/deactivated)
PROJECT 2
(can be activated/deactivated)
Enhancement 1
Enhancement 2
Enhancement 3
Function Exit
Screen Exit
Function Exit
X
March-2005
Function Exit
20
User-Exit Transactions
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.
21
March-2005
Transaction CMOD
In transaction CMOD, type in the name of your project and press the CREATE pushbutton.
22
March-2005
Transaction CMOD
Once you SAVE your project, you can add as many enhancements as you want by pressing the SAP enhancements pushbutton.
23
March-2005
Transaction CMOD
24
March-2005
Transaction CMOD
25
March-2005
Transaction SMOD
With the name of the enhancement, you can display its components.
26
March-2005
Transaction SMOD
In the case of enhancement SAPMF02K, there is only one user-exit a function-exit using the function module EXIT_SAPMF02K_001.
27
March-2005
Additional Information
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.
28
March-2005
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.
The concept of a function-exit involves various points in original SAP programs that have calls to specific function modules.
CALL CUSTOMER-FUNCTION statement will only execute a function module if the function module is activated. CMOD : This transaction allows you to create a PROJECT by identifying its ENHANCEMENT(S). SMOD : This transaction allows you to create an ENHANCEMENT, which you will include in a PROJECT, by identifying its COMPONENT(S).
29
March-2005
Questions
How do you obtain access key for changing a SAP standard object ?
30
March-2005