SlideShare a Scribd company logo
1 of 30
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

What's hot

0106 debugging
0106 debugging0106 debugging
0106 debuggingvkyecc1
 
How to extend an outbound i doc
How to extend an outbound i docHow to extend an outbound i doc
How to extend an outbound i docrupesh chouhan
 
SAP Validation and substitution
SAP Validation and  substitution SAP Validation and  substitution
SAP Validation and substitution Hari Krishna
 
Report Painter in SAP: Introduction
Report Painter in SAP: IntroductionReport Painter in SAP: Introduction
Report Painter in SAP: IntroductionJonathan Eemans
 
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...John Jordan
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questionsKranthi Kumar
 
User exit training
User exit trainingUser exit training
User exit trainingJen Ringel
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantAnkit Sharma
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reportsvbpc
 
Automatic vendor payment advice notes by mail
Automatic vendor payment advice notes by mailAutomatic vendor payment advice notes by mail
Automatic vendor payment advice notes by mailSURESH BABU MUCHINTHALA
 
Sap fi automatic payment program (configuration and run)
Sap fi   automatic payment program (configuration and run)Sap fi   automatic payment program (configuration and run)
Sap fi automatic payment program (configuration and run)Pradip Sarkar
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniquesJugul Crasta
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questionstechie_gautam
 
Technical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingTechnical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingJoshiRavin
 

What's hot (20)

Bapi step-by-step
Bapi step-by-stepBapi step-by-step
Bapi step-by-step
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
 
How to extend an outbound i doc
How to extend an outbound i docHow to extend an outbound i doc
How to extend an outbound i doc
 
SAP Validation and substitution
SAP Validation and  substitution SAP Validation and  substitution
SAP Validation and substitution
 
Report Painter in SAP: Introduction
Report Painter in SAP: IntroductionReport Painter in SAP: Introduction
Report Painter in SAP: Introduction
 
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...
A guide to functional areas and cost of sales P&L reporting in the SAP® Gener...
 
Abap reports
Abap reportsAbap reports
Abap reports
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questions
 
ABAP Advanced List
ABAP Advanced ListABAP Advanced List
ABAP Advanced List
 
User exit training
User exit trainingUser exit training
User exit training
 
SAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional ConsultantSAP BADI Implementation Learning for Functional Consultant
SAP BADI Implementation Learning for Functional Consultant
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reports
 
Sapscript
SapscriptSapscript
Sapscript
 
Reports
ReportsReports
Reports
 
FS for FICO
FS for FICOFS for FICO
FS for FICO
 
Automatic vendor payment advice notes by mail
Automatic vendor payment advice notes by mailAutomatic vendor payment advice notes by mail
Automatic vendor payment advice notes by mail
 
Sap fi automatic payment program (configuration and run)
Sap fi   automatic payment program (configuration and run)Sap fi   automatic payment program (configuration and run)
Sap fi automatic payment program (configuration and run)
 
SAP Modularization techniques
SAP Modularization techniquesSAP Modularization techniques
SAP Modularization techniques
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questions
 
Technical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_ProcessingTechnical specification : SD(Logistics)_Order_Processing
Technical specification : SD(Logistics)_Order_Processing
 

Viewers also liked

Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsGaruda Trainings
 
Prashant sap abap developer
Prashant sap abap developerPrashant sap abap developer
Prashant sap abap developerPrashant Singh
 
Dot Net 串接 SAP
Dot Net 串接 SAPDot Net 串接 SAP
Dot Net 串接 SAPLearningTech
 
Dr John Dee - Communications With Spirits - Free Ebook
Dr John Dee -  Communications With Spirits - Free EbookDr John Dee -  Communications With Spirits - Free Ebook
Dr John Dee - Communications With Spirits - Free EbookChuck Thompson
 
Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Kranthi Kumar
 
Creation of a web service in sap
Creation of a web service in sapCreation of a web service in sap
Creation of a web service in saprajdongre
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programmingSatheesh Kanna
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPnityaabap
 
SAP ABAP web services creation.
SAP ABAP web services creation. SAP ABAP web services creation.
SAP ABAP web services creation. Anjali Rao
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answersGarySpeed1234
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.docKranthi Kumar
 
Scenario on business transaction events
Scenario on business transaction eventsScenario on business transaction events
Scenario on business transaction eventsKranthi Kumar
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Panduka Bandara
 

Viewers also liked (17)

Badi document
Badi documentBadi document
Badi document
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
 
SAP ABAP Material
SAP ABAP MaterialSAP ABAP Material
SAP ABAP Material
 
Prashant sap abap developer
Prashant sap abap developerPrashant sap abap developer
Prashant sap abap developer
 
Dot Net 串接 SAP
Dot Net 串接 SAPDot Net 串接 SAP
Dot Net 串接 SAP
 
022006 zaidi badi
022006   zaidi badi022006   zaidi badi
022006 zaidi badi
 
Dr John Dee - Communications With Spirits - Free Ebook
Dr John Dee -  Communications With Spirits - Free EbookDr John Dee -  Communications With Spirits - Free Ebook
Dr John Dee - Communications With Spirits - Free Ebook
 
Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1Chapter 08 abap dictionary objects views1
Chapter 08 abap dictionary objects views1
 
Creation of a web service in sap
Creation of a web service in sapCreation of a web service in sap
Creation of a web service in sap
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAP
 
SAP ABAP web services creation.
SAP ABAP web services creation. SAP ABAP web services creation.
SAP ABAP web services creation.
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answers
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.doc
 
Scenario on business transaction events
Scenario on business transaction eventsScenario on business transaction events
Scenario on business transaction events
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1
 

Similar to Chapter 01 user exits

User exits
User exitsUser exits
User exitsanilkv29
 
Variables in sap bi
Variables in sap biVariables in sap bi
Variables in sap bishabari76
 
BADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdfBADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdfssuser08365f
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 Rehan Zaidi
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsRehan Zaidi
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsHicham Khallouki
 
SAP PM and xMII
SAP PM and xMIISAP PM and xMII
SAP PM and xMIIhackaback
 
Acumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization GuideAcumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization Guidedaloe
 
SAP AC020 - Investment Management
SAP AC020 - Investment ManagementSAP AC020 - Investment Management
SAP AC020 - Investment ManagementVannak9
 
Panelsaw sawteq-b-400-e
Panelsaw sawteq-b-400-ePanelsaw sawteq-b-400-e
Panelsaw sawteq-b-400-eAmirStern2
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoIRJET Journal
 
Vb6 ch.6-3 cci
Vb6 ch.6-3 cciVb6 ch.6-3 cci
Vb6 ch.6-3 cciFahim Khan
 
ControlSystemsAutogenBrochure
ControlSystemsAutogenBrochureControlSystemsAutogenBrochure
ControlSystemsAutogenBrochureTony Simeonov
 
Accel_Series_2022Spring_En.pptx
Accel_Series_2022Spring_En.pptxAccel_Series_2022Spring_En.pptx
Accel_Series_2022Spring_En.pptxNTTDATA INTRAMART
 
In Mind Cloud - Product Release - 1904
In Mind Cloud - Product Release - 1904In Mind Cloud - Product Release - 1904
In Mind Cloud - Product Release - 1904In Mind Cloud
 
11 Enhancements & Modifications.pptx
11 Enhancements &     Modifications.pptx11 Enhancements &     Modifications.pptx
11 Enhancements & Modifications.pptxSaiRahulReddy4
 

Similar to Chapter 01 user exits (20)

User exits
User exitsUser exits
User exits
 
CATS Approval.pdf
CATS Approval.pdfCATS Approval.pdf
CATS Approval.pdf
 
Variables in sap bi
Variables in sap biVariables in sap bi
Variables in sap bi
 
BADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdfBADI IMPLEMENTATION.pdf
BADI IMPLEMENTATION.pdf
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflows
 
SAP PM and xMII
SAP PM and xMIISAP PM and xMII
SAP PM and xMII
 
Acumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization GuideAcumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization Guide
 
SAP AC020 - Investment Management
SAP AC020 - Investment ManagementSAP AC020 - Investment Management
SAP AC020 - Investment Management
 
Panelsaw sawteq-b-400-e
Panelsaw sawteq-b-400-ePanelsaw sawteq-b-400-e
Panelsaw sawteq-b-400-e
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
Vb6 ch.6-3 cci
Vb6 ch.6-3 cciVb6 ch.6-3 cci
Vb6 ch.6-3 cci
 
ControlSystemsAutogenBrochure
ControlSystemsAutogenBrochureControlSystemsAutogenBrochure
ControlSystemsAutogenBrochure
 
Cube remodelling
Cube remodellingCube remodelling
Cube remodelling
 
Accel_Series_2022Spring_En.pptx
Accel_Series_2022Spring_En.pptxAccel_Series_2022Spring_En.pptx
Accel_Series_2022Spring_En.pptx
 
In Mind Cloud - Product Release - 1904
In Mind Cloud - Product Release - 1904In Mind Cloud - Product Release - 1904
In Mind Cloud - Product Release - 1904
 
11 Enhancements & Modifications.pptx
11 Enhancements &     Modifications.pptx11 Enhancements &     Modifications.pptx
11 Enhancements & Modifications.pptx
 
Harikrishna anumandla
Harikrishna anumandlaHarikrishna anumandla
Harikrishna anumandla
 
enhancements.ppt
enhancements.pptenhancements.ppt
enhancements.ppt
 

More from Kranthi Kumar

Creating simple comp
Creating simple compCreating simple comp
Creating simple compKranthi Kumar
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programmingKranthi Kumar
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseKranthi Kumar
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)Kranthi Kumar
 
Chapter 07 debugging sap scripts
Chapter 07 debugging sap scriptsChapter 07 debugging sap scripts
Chapter 07 debugging sap scriptsKranthi Kumar
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script formsKranthi Kumar
 
Chapter 05 sap script - configuration
Chapter 05 sap script - configurationChapter 05 sap script - configuration
Chapter 05 sap script - configurationKranthi Kumar
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output programKranthi Kumar
 

More from Kranthi Kumar (20)

Exercise in alv
Exercise in alvExercise in alv
Exercise in alv
 
Dynamic binding
Dynamic bindingDynamic binding
Dynamic binding
 
Data binding
Data bindingData binding
Data binding
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple comp
 
Creating messages
Creating messagesCreating messages
Creating messages
 
Creating a comp
Creating a compCreating a comp
Creating a comp
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programming
 
Context at design
Context at designContext at design
Context at design
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exercise
 
Alv for web
Alv for webAlv for web
Alv for web
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
 
Abap faq
Abap faqAbap faq
Abap faq
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Crm technical
Crm technicalCrm technical
Crm technical
 
control techniques
control techniquescontrol techniques
control techniques
 
Chapter 07 debugging sap scripts
Chapter 07 debugging sap scriptsChapter 07 debugging sap scripts
Chapter 07 debugging sap scripts
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script forms
 
Chapter 05 sap script - configuration
Chapter 05 sap script - configurationChapter 05 sap script - configuration
Chapter 05 sap script - configuration
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output program
 
sap script overview
sap script overviewsap script overview
sap script overview
 

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

  1. 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.
  2. 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.
  3. 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.
  4. Go to the registration tab. Go to Register Objects.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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”.
  11. 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.
  12. Using transaction “SE38” (ABAP Editor), display the program “SAPMF02K”.
  13. Search for the string “call customer-function” in the main program to find the function-exit(s) in the program.
  14. 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.
  15. 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).
  16. 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.
  17. 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”).
  18. 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]
  19. 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).
  20. 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.
  21. Next, you enter a short description and save the project. Then, you need to add enhancements to the project (press the “Enhancement assignments’’ pushbutton).
  22. 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.
  23. 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.
  24. 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.
  25. 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.