Sie sind auf Seite 1von 24

Ways to find a userexit

 Page restrictions apply


 Added by Andrea Olivieri, last edited by Alon Mizrahi on Nov 01, 2011 (view change)

Ways to find a userexit


This page lists some useful methods that can help while searching for the exit routines

How can we FIND THE AVAILABLE Userexits?

Application- Specific User Exits (Userexit)

 SAP Reference IMG -> Sales and Distribution -> System Modifications -> Userexits
 Locating Applications that Have Exits

Customer Exits(SMOD/CMOD)

 ABAP Workbench -> Utilities -> Enhancements -> Definition (SMOD).


 Repository Info System (SE84): Enhancements -> Customer Exits -> Enhancements

VOFM Routines

 SAP Reference IMG -> Sales and Distribution -> System Modifications -> Routines
 Transaction code: VOFM

Business Transaction Events

 SAP Reference IMG -> Financial Accounting -> Financial Accounting Global Settings ->
Business Transaction Events (FIBF)
 Business Event Repository (BERE)

Classic BAdIs

 Repository Info System (SE84):Enhancements -> Business Add-ins -> Definitions


 Accelerators: Find BAdI: Find the BADI related to your transaction in minutes

Enhancement Framework

 Enhancement Information System in the Object Navigator (transaction SE80).


 Repository Info System (SE84): Enhancements -> Enhancements Spots
 Repository Info System (SE84): Enhancements -> Composite Enhancements Spots
 Accelerators: Find Enhancement Points/Sections: ABAP Ninja

Validations and Substitutions exits

 Transaction code GGB0: Validation Overview


 Transaction code GBB1: Substitutions Overview

How can we FIND THE IMPLEMENTED Userexits?

Application- Specific User Exits (Userexit)

 Modification Browser (SE95)

Field Exit
 Report RSMODPRF

Customer Exits(SMOD/CMOD)

 ABAP Workbench -> Utilities -> Enhancements -> Project Management (CMOD).
 Repository Info System (SE84): Enhancements -> Customer Exits -> Projects

VOFM Routines

 Transaction code: VOFM


 Modification Browser (SE95)

Business Transaction Events

 SAP Reference IMG -> Financial Accounting -> Financial Accounting Global Settings ->
Business Transaction Events (FIBF)
 Business Event Repository (BERE)

Classic BAdIs

 Repository Info System (SE84): Enhancements -> Business Add-ins -> Implementations

Enhancement Framework

 Enhancement Information System in the Object Navigator (transaction SE80)


 Repository Info System (SE84): Enhancements -> Enhancements Implementations
 Repository Info System (SE84): Enhancements -> Composite Enh. Implementations

Blogs and Articles


 How Many Exit Routines are active in your SAP ERP system?
 SAP User Exits and the People Who Love Them
 Finding BADI Using SQL Trace (TCODE-ST05)

Accelerators
 ABAP X-it Ray Eye (Scans all the exit routines active in SAP ERP)
 To find out User Exit's and BADI's for Any Transaction code
 Find User-exits, BADIs, BTEs, Etc by TCode or Program

Best Practices
 Best Practice for a SAP ECC Consolidation project: filter dependent BAdI to organize the
user-exits and enhancements
 Dangerous Liaisons in User-Exits and How to Avoid Them
 Dangerous Liaisons in User-Exits - Revisited

Relevant SAP Notes


 381348 - Using Userexit, Customer Exit, VOFM in SD
 842318 - FAQs about validations + substitutions
 356737 - Customer name range for VOFM routines
 327220 - VOFM function and its objects
 29377 - FAQs: Field exits (CMOD)

http://wiki.sdn.sap.com/wiki/display/ABAP/Ways+to+find+a+userexit
Customer Exits (CMOD)

. Introduction

Customer exits (aka user exits) are possibilites offered by SAP at strategic moments to call
customer ABAP code so that to enhance the standard. Hence, customer exits acts as 'Hook'
points for the custom business functionality.

These exits are function modules called by SAP, with fixed input and output parameters, and only
containing an INCLUDE ZX... ABAP statement, that the client may create. The exit belongs to
exactly one Enhancement (an 8 characters code), that SAP creates using SMOD transaction.

To add ABAP code, the client has to create a Project via CMOD transaction, link it to the
Enhancement, create the ZX... include where he puts ABAP code, and activate both the include
and the project.

Note: since NetWeaver 7.0, this concept is obsolete because replaced by the classic and new
BAdIs, and SAP does not create any more customer exit. Moreover, SAP may have migrated some
customer exits to classic BAdIs (an enhancement is migrated into a BAdI definition, and its
customer exits are migrated into methods with the same names and signatures, i.e. list of
parameters).

 More documentation is provided in SAP Library - Customer Exits.


 For more general documentation on Enhancements, go to SDN Home Page -
Enhancements and Modifications
 This wiki shows screen captures of how to create a project

 . How SAP calls the exit

 The call to an exit is implemented by SAP as:

 CALL CUSTOMER-FUNCTION '<3 digit suffix>'

 [EXPORTING <parameters>]

 [IMPORTING <parameters>]

 [CHANGING <parameters>]

 [TABLES <parameters>]

 [EXCEPTIONS <exceptions>].

 Which calls function module EXIT_<program name>_<3 digit suffix> (where <program
name> is the program which calls the customer function).

Which calls function module EXIT_<program name>_<3 digit suffix> (where <program name> is
the program which calls the customer function).

Notes:

 Sometimes, SAP uses directly CALL FUNCTION statement because the exit needs to be
called from 2 different programs.
 The difference between the 2 ABAP statements is that CALL CUSTOMER-FUNCTION does
NOT call the function module if it is not linked to an active project (see below "how to implement
an exit"). Thus, a break-point in the function module will be ineffective.

In this function module, SAP usually puts this code:


INCLUDE ZX<3 characters>U<2 digits>.

Example:

 The program for transaction VA01 Create sales order is 'SAPMV45A'


 In program SAPMV45A (SAP R/3 or ECC), there is:

CALL CUSTOMER-FUNCTION '003'

exporting

xvbak = vbak

xvbuk = vbuk

xkomk = tkomk

importing

lvf_subrc = lvf_subrc

tables

xvbfa = xvbfa

xvbap = xvbap

xvbup = xvbup.

 It means that it will call the function module 'EXIT_SAPMV45A_003', which only contains
this code: INCLUDE zxvvau05.
 (as already said, this include is not initially delivered by SAP, but it may be created by
the client)

3. How to implement an exit

First of all, the client must check whether an existing customer exit fits his requirements. There
are 2 main ways to do this:

1. Use transaction SPRO (SAP IMG reference guide) and look for activities named
"enhancement" or "extension" and display its documentation.
2. OR get the main program which corresponds to the transaction (status option in system
menu), so that you know the potential exit function module names (EXIT_<program
name>_*), then look at their documentation (SE37 transaction) or at the documentation
of their corresponding enhancement (SMOD transaction).
a. You may get the enhancement and enhancement projects associated to the
customer exit by using the extended options of the search help, or by using
transaction SE84 - Repository Information System.

Now, you may implement the exit this way:

 Go to transaction CMOD
 Create a project
 Go to the Enhancement screen, and enter the Enhancement code which contains the
user exit. Note that an enhancement can only be used in 1 project.
 Go to the Components screen (where the available customer exits are displayed). Double
click on the one you want to implement.
 Now the function module is displayed, double click on the include ZX..., SAP displays a
warning that this include will be created
 Press enter, SAP asks for a package and a transport request
 Insert the ABAP code into the include
 Activate the include program. Go back to CMOD and activate the project.

Example:

 For example, we want to enhance transaction 'VA01', so that to default Sold-to-party field
to value "2155". We already know that we have to implement user exit EXIT_SAPMV45A_002,
which belongs to enhancement V45A0002
 Go to transaction CMOD
 Create a project called ZVA01
 Choose the Enhancement assign radio button and press the Change button
 In the first column enter 'V45A0002', predefine sold-to party in sales document.
 Press Save
 Go to the Components tab. You can now see that enhancement uses user exit
EXIT_SAPMV45A_002. Double click on the exit.
 Now the function module is displayed. Double click on include ZXVVAU04 in the function
module
 Insert the following code into the include: E_KUNNR = '2155'.
 Activate the include program. Go back to CMOD and activate the project.
 Go to transaction VA01 and create a salesorder.
 You see that Sold-to-party is automatically set to "2155"

http://wiki.sdn.sap.com/wiki/display/ABAP/Customer+Exits+(CMOD)

http://wiki.sdn.sap.com/wiki/display/ABAP/Enhancements+(User+Exits+and+Customer+exits)

Summary

The enhancement concept allows you to add your own functionality to SAP's standard business
applications without having to modify the original applications. To modify the standard SAP
behavior as per customer requirements, we can use enhancement framework.
This document explains about User exits and Customer Exits.

Author(s): Tutun Nandy

Company: Infosys Technology Ltd


Created on: 20 May 2010

Author(s) Bio

Tutun Nandy is working with Infosys Technology Ltd since 2008. His expertise includes SAP
ABAP.

Table of Contents

1) Overview of this document........................................................


2) User Exit with example............................................................

3) Customer Exit........................................................................

4) Types of Customer Exits..........................................................

5) Function Module exits.............................................................

6) Screen Exist.........................................................................

7) Menu Exits...........................................................................

8) Methods to find out customer Exits...........................................

9) CMOD and SMOD transactions................................................

Overview of this document


The enhancement concept allows you to add your own functionality to SAP's standard business
applications without having to modify the original applications. To modify the standard SAP
behavior as per customer requirements, we can use enhancement framework.
There are different ways to implement custom functionality in the SAP standard code. ex: User
exits, customer exits, BADI etc.
This document explains about User exits and Customer Exits.

User exits
These are implemented in the form of subroutines and hence are also known as FORM EXITs.
The user exits are generally collected in includes and attached to the standard program by the
SAP.
User exits are a type of system enhancement that was originally developed for the R/3 SD (Sales
and distribution) module. User-exits are empty subroutines that SAP Developers have provided
for you. You can fill them with your own source code. Technically this is a modification.
All User exits start with the word USEREXIT_...
FORM USEREXIT_XXXX....
INCLUDE ZZUSEREXIT.......
ENDFORM.

User exits can be found in the following ways:


Go to Object Navigator (SE80), select Package and put VMOD (Application development R/3 SD
customer modification) and press enter. You will find all the includes for user exits in SD. You will
get User exits for Sales order, Delivery, Billing, Pricing etc. Most of the time documentation is
maintained for each subroutine which helps developer for better understanding of the
subroutine. Select the subroutine according to the requirement and start coding within the
subroutine.

Examples:
- In User exits MV45AFZZ(Sales Order Exit), we have subroutine
USEREXIT_PRICING_PREPARE_TKOMK
USEREXIT_PRICING_PREPARE_TKOMP
This user exit can be used to move additional fields into the communication table which is used
for pricing. TKOMK for header fields and TKOMG for item fields. The fields which are not in either
of the two tables KOMK and KOMP cannot be used in pricing.
zvendpgm (Vendor Program), zpricegrp (Price Group), kvgr5(Airport Code) fields value moving
from VBAP to KOMP table.

- In User exits MV50AFZ1(Delivery Exit), you have subroutine


USEREXIT_SAVE_DOCUMENT_PREPARE
This user exit can be used for changes or checks, before a document is saved.

Customer exits
SAP creates customer exits for specific programs, screens, and menus within standard
applications. These exits do not contain any functionality. Instead, the customer exits act as
hooks. You can hang your own add-on functionality onto these hooks.
Customer exits are nothing but a include in customer name space will be provided in the
function module which starts with CALL CUSTOMER. You can fill them with your own source
code. Technically this is an enhancement. User exits generally refer to SD module while
customer exits refer to all modules like MM, SD, PP, FICO etc.

Advantage:
- They do not affect standard SAP source code
- They do not affect software updates
Disadvantage:
- Customer exits are not available for all programs and screens found in the SAP System. You can
only use customer exits if they already exist in the SAP System.

Types of Customer Exits


1. Function Module exits
2. Screen exits
3. Menu exits

1. Function Module exits


Function module exits are exits developed by SAP. The exit is implemented as a call to a function
module. The code for the function module is written by the developer. You are not writing the
code directly in the function module, but in the include that is implemented in the function
module.
Format: CALL CUSTOMER-FUNCTION '910'
The naming standard of function modules for function module exits is:
EXIT_<program name>_<3 digit suffix>
Examples:

Before User exits using: No error comes for any Country code.

Below Function Module Exits: EXIT_SAPMF02K_001.

We are writing our code in the Include ZXF05U01.

After User exits using: Error comes for any Country code like 'IN'. Only permissible country code
is 'US'.
2. Screen Exits:
Allow customer to add fields to a screen via a sub screen in an SAP program. The sub screen is
called within the standard screen's flow logic.
Format: CALL CUSTOMER-SUBSCREEN CUSTSCR1
3. Menu exits:
Menu exits allow you to add your own functionality to menus. Menu exits are implemented by
SAP and are reserved menu entries in the GUI interface. The developer can add his/her own text
and logic for the menu.
Function codes for menu exits all start with "+".
Format: +CUS (additional item in GUI status)
Methods to find out customer Exits:
There are numbers of way by using we can find out Customer Exits.

Method # 1: Call customer


If you are searching customer exits based on particular transaction.

Go to Transaction. Ex: VA01.

Then system-> status

Double click on Program(screen).


Find(Cntrl+F)

Then use Call customer and select in main program radio button tab and press Enter.

We can find out all the possible Customer exits based on this transaction.
Method # 2: SMOD
Go to Transaction SMOD (SAP Enhancement).

Then Utilities-> Find

Give Package name and Execute (F8).


For Purchase Order package is ME.
We can find out all the possible Enhancement (Customer exits) based on this package.

Method # 3: SE84
Go to Transaction SE84.
Select Enhancements -> Customer Exits -> Enhancements

Give Package and Execute. We can find out all the possible Enhancement (Customer exits) based
on this Package.
Method # 4: SE81
Go to Transaction SE81.

Click on Module name (ex: SD).

Then from top menu select Edit -> Select sub tree +/-.

Select Information System.


A new Screen will appear, it looks like SE84.
Then select Enhancements -> Customer Exits ->Enhancements.

Double click on Enhancements and Execute.


We can find out all the possible Enhancement (Customer exits) based on this Module.

Method # 5: ST05
Go to Transaction ST05. Select Table Buffer Trace & Activate Trace.

Then go to the transaction, based on which you want to see the customer exits.
Come back to ST05, Deactivate Trace & display Trace.
Then go to FIND & write text EXIT_ & press ENTER.
We can find out all the possible Enhancement (Customer exits) based on this Transaction .This
is not good technique to find out customer exits because all the possible exits may not be find
out using this technique.

SAP Enhancements (SMOD):


This transaction is used to see the list of objects in an enhancement. It is a container which
holds many related objects within it.

If you Double click on TEST button, you will get below screen.
From the above screen shot we can say that the Function Exit is already implemented (Green
light) but in Inactive stage (Red light).
Project Creation (CMOD):
This Transaction is used to create a project. Project is also a container, which holds several
Enhancements. If we identify the User Exits and write down the code only within it, then the
functionality will not be worked. That is why we require adding the enhancement into a project &
making it active.
CMOD Transaction is used to create a project.

Select Enhancement assignments and you add your Enhancement in this project.

You can add multiple Enhancements in one project. But you can't add one enhancement in
multiple projects. Then error message will be generated.

Error message generate, because Enhancement V45A0002 is already exist in other project.
From screen short no: 2 of CMOD description, if we click on Components, we will get the list of
Customer exits belongs to these enhancements.

Both green light shows that the exit is already implemented & is Active stage.

http://www.saptraininghub.com/what-is-user-and-customer-exits/

What is Customer Exits ?

Customer exits are “hooks” provided by SAP within many standard programs, screens and menus

on which customers may “hang” custom functionality to meet business requirements. More on

this in a moment…

Types of Customer Exits


There are three main types of customer exits:

1. Function Module Exits

2. Screen Exits

3. Menu exits
Function Module Exit:It allows customer to add code via a function module at a specific location

in an SAP application program

Syntax: CALL CUSTOMER-FUNCTION ’004′

Menu Exit: It allows customer to add items to a pulldown menu in a standard SAP program.

These items may be used to call add-on programs or custom screens.

Format: +CUS ( additional item in GUI status )

Screen Exit: It allows customer to add fields to a screen in an SAP program via a subscreen. The

subscreen is called within the standard screen’s flow logic.

Format: CALL CUSTOMER-SUBSCREEN CUSTSCR2

Examples of Customer Exits


Example of a Screen Exit:

In transaction CAT2 – Time Sheet Entry, HR wishes to include an interactive acknowledgment that

knowingly submitting incorrect data is grounds for dismissal.

Example of a Menu Exit:

In transaction SE38 – ABAP Editor, the development team wishes to include a menu link to

transaction SE80 – Object Navigator for ease of use.


BEFORE

AFTER

Example of a Function Module Exit:

The company wants the bank details of the Vendors in the Vendor creation to be mandatory

event .So it must flash a error message that ‘Please Enter the bank details’

BEFORE
AFTER

Locating Customer Exits


In transaction SMOD and look into the details-
Or in transaction SE81 you can use the appropriate application area

Create a Customer Exit


To create a customer exit you first need to create a project in transaction CMOD
Later you assign the Customer Exit to your project.

What is a USER EXIT?


User Exit serve the same purpose as Customer Exits but they are available only for the SD

module. The exit is implemented as a call to a Function Module. The code is written by the

developer.

Well know User Exit in SD is MV45AFZZ

 USEREXIT_FIELD_MODIFICATION – To modify screen attributes

 USEREXIT_SAVE_DOCUMENT – To perform operations when user hits Save

 USEREXIT_SAVE_DOCUMENT_PREPARE

 USEREXIT_MOVE_FIELD_TO_VBAK – When user header changes are moved to header

work area.

 USEREXIT_MOVE_FIELD_TO_VBAP – When user item changes are moved to SAP item

work area

You might like:

What is BADI?
All About BAPI

What is EDI ,ALE and iDOC?

How to Create One time Customer Master

All About Smart Forms

All About Smart Forms

How to Create One time Customer Master


What is EDI ,ALE and iDOC?

All About BAPI

What is BADI?

Das könnte Ihnen auch gefallen