Introduction To SAP Enhancements
Introduction To SAP Enhancements
SAP is an ERP software in which all standard business applications are delivered, sometimes
customer may need to alter existing functionality or add additional functionality to the
existing applications based on customer business requirements.
Enhancements concept
The enhancement is a concept of adding your own functionality to SAP's standard business
applications without having to modify the original applications. To modify the standard SAP
behaviour as per customer requirements, we can use enhancement framework.
User Exits
Initially SAP implemented enhancements in the form of User Exits and these are only
available in SD module, user exits are implemented in the form of subroutines and hence are
also called as FORM EXITS, User exits are empty subroutines that SAP developers have
provided for you, you can add your own source code in the empty subroutines.
Customer Exits
These are one type of enhancements that are available in some specific programs, screens and
menus within standard SAP Applications. These are Function Modules with a custom empty
include program, you can add your own functionality in these include programs.
Customer Exits are available in all SAP modules, whereas user exits are only available in SD
module.
All customer exits (Function Modules) starts with CALL CUSTOMER word.
These are implemented in the form of subroutines and hence are also known as FORM
EXITs. The user exits are generally 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.
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.
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.
- 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.
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__<3 digit suffix>.
Examples: Function Module Exits: EXIT_SAPMF02K_001.
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. For this we need to implement FM
Exits/Menu Exits to write the logic for Screen Exits . All screen exits will be subscreens.
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)
There are numbers of way by using we can find out Customer Exits.
Project: It is an SAP Object which contains list of Enhancements. A project must be created
for each enhancement so that the corresponding exits in an enhancement will be in active
state.
So, A project is group of Enhancements An Enhancement cannot be linked to more than one
project. It throws error CMOD is the Tcode for creating a project.
A pop up will open, you can find the program name, copy the program name and go to SE38,
display ( simply double click to go to program source ).
You will find the list of Function Modules with the word CALL CUSTOMER.
Double click on function module CALL CUSTOMER-FUNCTION '911', you can see a
include 'INCLUDE ZXOIKU46', that`s where you can implement your own functionality .
Business Requirement: When ever business user creates a delivery order, the standard SAP
application dose not check for storage location (whether it is space or not ), if it is space it should
raise a error message.
VL01 is the t-code for creating a deliver order, this uses standard SAP program SAPMV50A,
the standard program don`t check for storage location equal to space or not.
As per the requirement we need to find a suitable user exit for this and we need add
additional code to check storage location.
Technical information : Storage location field is LGORT and it is available in LIPS table.
To implement the user exit for this we need to follow the below steps.
Click on Find icon, select main program, find 'userexit' and press enter.
You will find number of performs.
Verify the user exits for suitable exit
You'll have to roughly decide which is the correct user exit routine to used. So, For my
requirement I used the below user exit.
Now go to table LIPS, display, get a deliver no and go to VL02N (T-code for changing
deliver order), provide delivery order no and enter.
click on Save (Ctrl S), debugger will open..now this is the suitable exit.
To implement user exit we need access key from SAP, when we get access key from SAP, write below
code inside from.
If lips-lgort = ' ' . "check if storage location is initial
Message 'Storage location is mandatory field' TYPE 'E'. "error message
Endif .
Save, Activate and test.
Technical requirements:
To implement the Customer exit for this we need to follow the below steps.
Double click on Program name SAPMF02D.Click on Find icon, main program, find CALL
CUSTOMER, enter.
A list of call customer functions will be displayed.
Based on requirement, Check Import/Export Parameters for each Function Module And
roughly select some Customer Function Modules .
As per this requirement, we need KNA1 Table details, So we can use the below Customer
Function Module which has an exporting parameter I_KNA1.
Then verify the customer exit (function module) wheather it will full-fill requiremnt.
Double click on Function module name and put the break point .
Stop the Debugging and now implement the Functional Module Exit. As this exit is triggered,
this is the suitable Functional Module Exit for our requirement.
All the enhancements for customer exits will be stored in MODSAP table, we can get
enhancement name by using our customer exit.
Get Function module name from customer exit, double click on CALL CUSTOMER
FUNCTION '001'.
Not down the Function Module name, go to SE11, provide table name MODSAP, display,
contents and provide enhancement/member as EXIT_SAPMF02D_001, execute.
You will find the enhancement name for the function exit.
Now go to CMOD and to project ZXD01_EX and click on enhancement assignments and add
enhancement as SAPMF02D, enter and click on components.
You will find Function module name, double click on function exit.
You will find a include inside the function module, double click to create and add your own
code.
And add below code.
Go to XD02 .
Enter a Customer
Change Country to DE and Region to space .
Function exit
Screen Exit
User exit is implemented in the form of a Subroutine
Menu Exit
i.e. PERFORM xxx.
PERFORM userexit_save_document_prepare. Field Exit