What is a User Exit?
You can use User Exits to adapt the SAP System to your company's specific requirements. They do not involve modifications to the original coding; instead, they consist of a separate area that is defined by SAP and shipped with the standard system either empty or with default values. You can individually configure and activate these system extensions. By enhancing the SAP software via user exits, we avoid modifications in the traditional sense.
A further advantage of user exits is that programs developed with user exits remain unchanged during upgrades to the SAP software.
User exits are not affected by SSCR, because the customer-specific parts of the user exits are implemented in the customer name range.
Three types of user exits exist:
- Function exits. Function exits are function modules that have been defined by SAP and that you can activate. The application developers determine which data is passed on and define the function groups and function modules in the function library (with short text and interface, but without coding).
- Menu exits. Menu exits can be used to activate menu items and furnish them with additional functionality.
- Screen exits. Screen exits enable you to add additional fields to a screen.
Request for Expansion of User Exits
If you would like to have additional functionality at certain places in the R/3 System, enter a problem message in
You can display a list of existing enhancements in the system through the following menu path:
ABAP/4 Workbench B Environment B Enhancements B Project administration B Utilities B SAP enhancements.
http://sapr3.tripod.com/sapab013.htm
SAP User Exits Routine
User exits are routine which SAP allows you to add in additional customized programs process without affecting the standard SAP programs.
form userexit_xxxxx
........................
endform
In VL01 - Create Delivery Order, standard program SAPMV50A, the standard program did not check for storage location equal to space, and delivery quantity less than one when the user click the save button. Therefore I have to insert the additional checking into the userexit routine.
Steps:-
- Goto transaction VL01 to pick a Sales Order for delivery (you don't have to save the data)
- In the initial screen, click System -> Status -> Double click on Program (Screen)
- In the dialog program SAPMV50A, click Edit -> Search/replace
- Type userexit in the Find field, then click the In program radio button and hit Enter
- A number of userexit routine will be display. You'll have to roughly decide which is the correct userexit routine to used.
form userexit_save_document_prepare.
case xlips-pstyv.
when 'TAX' or 'REX'.
* Accept this two Delivery item category
when 'REN'.
if xlips-lgort = space.
* Reject this Delivery item category
message e001.
endif.
when others.
if xlips-matnr <> space.
* Check storage location not space
if xlips-lgort = space.
message e002.
endif.
* Check delivery quantity not zero
if xlips-pikmg < 1. message e003. endif. endif. endcase. endform.