Beruflich Dokumente
Kultur Dokumente
SAP Reference IMG -> Sales and Distribution -> System Modifications -> Userexits
Locating Applications that Have Exits
Customer Exits(SMOD/CMOD)
VOFM Routines
SAP Reference IMG -> Sales and Distribution -> System Modifications -> Routines
Transaction code: VOFM
SAP Reference IMG -> Financial Accounting -> Financial Accounting Global Settings ->
Business Transaction Events (FIBF)
Business Event Repository (BERE)
Classic BAdIs
Enhancement Framework
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
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
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
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).
[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.
Example:
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)
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.
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) Bio
Tutun Nandy is working with Infosys Technology Ltd since 2008. His expertise includes SAP
ABAP.
Table of Contents
3) Customer Exit........................................................................
6) Screen Exist.........................................................................
7) Menu 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.
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.
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.
Before User exits using: No error comes for any Country code.
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.
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).
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.
Then from top menu select Edit -> Select sub tree +/-.
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.
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/
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…
2. Screen Exits
3. Menu exits
Function Module Exit:It allows customer to add code via a function module at a specific location
Menu Exit: It allows customer to add items to a pulldown menu in a standard SAP program.
Screen Exit: It allows customer to add fields to a screen in an SAP program via a subscreen. The
In transaction CAT2 – Time Sheet Entry, HR wishes to include an interactive acknowledgment that
In transaction SE38 – ABAP Editor, the development team wishes to include a menu link to
AFTER
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
module. The exit is implemented as a call to a Function Module. The code is written by the
developer.
USEREXIT_SAVE_DOCUMENT_PREPARE
work area.
work area
What is BADI?
All About BAPI
What is BADI?