What is user exit
This blog is based on users exits in sap. User Exits is one of the very first tools SAP has provided to execute custom code within the standard SAP control flow. The enhancement principle helps you to apply your own features to the existing business applications of SAP without having to change the original applications. We may use the enhancement system to change the standard SAP actions according to customer requirements.
SAP software has over 65,000 installations worldwide. There are many reasons for this success. But one key reason is the flexibility and ability to shape the system into key business processes. SAP allows you to create custom code enhancements to the development environment using ABAP code. Routines, user exits, and customer exits (in some parts) leave a reasonable amount of liability to the customer, but developers need to explore alternatives before beginning any client-defined routine or user exit.
SAP offers more than one method or technology to customize and improve standard functionality. Today, we will focus on enhancing existing Sales and Distribution (SD)/Material Management (MM)/Financial Accounting(FI) functionality with ABAP code.
Different ways of adapting the SAP system
There are four different ways to adapt the SAP system to meet your needs:
- Customizing: Configuration of system parameters via a special interface, pre-planning of possible changes, and organized customization are required during the implementation of the system.
- Modification: Alteration of SAP repository objects in the form of custom modifications when SAP changes occur, the customer version must be reconciled manually.
- Change of SAP Repository Objects by Customer without modification.
- Custom development: the creation of custom objects within the range of the customer name.
Advantages of user exits
There are two main reasons why you should use exits instead of modifying SAP software on your own. Add-ons attached to the exits have the advantage of:
- They do not affect standard SAP source code.
- They do not affect software updates.
- Enhancements can be achieved by Exits.
How to write user exit in sap
User exits are preplanned exit routines in standard coding, which means that SAP has intentionally left them empty within the standard code. Outputs of the user can only be found within the component. Historically, when viewed from a technical point of view, the user has required modifications. Nevertheless, this changed with the introduction of the Enhancement System.. User exits are sometimes referred to as form exits because they are subroutines.
User-Exit is one of the first SAP mechanisms for executing custom code between regular SAP control flows. This is done as a subroutine call (PERFORM xxx). The classic example for User-Exit is that MV45AFZZ is included in the order processing module of SAP R/3. Although this includes an object that does not fall under the namespace of the client, the object does not get overwritten during an upgrade.
How to implement user exit in SAP ABAP
Enhancement points in SAP
- Where enhancement is required to be incorporated directly into the ABAP source code, this technology shall be provided. The implementation of this technology is also called the Source Code Plug-In. There are two types of enhancements to the Source Code that are possible.
- Implicit enhancement option
- Explicit enhancement option
- You need to be in ‘Change Enhancement Mode’ (the spiral icon available in the editor) to implement any of these Source Code enhancements. Technically, the source code plug-in implementations are stored in a separate include program, not as part of the original source program.
Implicit enhancement option: The enhancement options are automatically available at certain pre-defined locations throughout the ABAP system. Some of the implicit options are as follows:
- At the end of all the programs (Includes, Reports, Function pool, Module pool, etc.), after the last statement
- At the beginning and end of all FORM subroutines
- At the end of all Function Modules
- At the end of all visibility areas (public, protected and private) of local class
To view all the implicit options available in source code, choose ‘Edit -> Enhancement Operations -> Show Implicit Enhancement Options’ from the editor.
Explicit Enhancement Option: two types of Explicit Enhancement options are available. Another that can be given at a particular location-called Enhancement Stage, and another that can be used to replace a collection of statements-called Enhancement Page. We now have two new ABAP statements for this, viz.
Once the Enhancement Section is applied, only the enhancement is executed and the initial code is not executed. It is a modern strategy, which has not existed before in any of the old forms of improvement, to remove any regular SAP code from execution. As a consequence, there can only be one successful implementation of the Enhancement Section. In the other hand, there could be several active implementations of the Enhancement-Point, in which case all implementations would be implemented without any certainty in the order of execution.
User exit in sap tcode
CMOD : This transaction helps you to create a PROJECT by defining the ENHANCEMENT(s) of the transaction. You will need to enable the PROJECT after evaluating all the Upgrades that are part of the PROJECT. You will also need to code your user exit; hence, you may want to wait until this phase is completed before the PROJECT is enabled.
SMOD: This transaction facilitates the development, by defining your COMPONENT(s), of an ENHANCEMENT that will be included within the Project. If SAP has already created an ENHANCEMENT for its predefined user exits, you do not need to use the SMOD transaction; instead, you can only use the CMOD transaction.
User exit in Sap SD
The following SAP enhancements are available for the SD
Sales Order Processing (Module Pool – SAPMV45A)
- USEREXIT_DELETE_DOCUMENT -(MV45AF0B_BELEG_LOESCHEN)
- USEREXIT_FIELD_MODIFICATION -(MV45AFFE_FELDAUSWAHL_LORD)
- USEREXIT_MOVE_FIELD_TO_VBAK -(FV45KFAK_VBAK_FUELLEN)
- USEREXIT_MOVE_FIELD_TO_VBAP -(FV45KFAK_VBAP_FUELLEN)
- USEREXIT_MOVE_FIELD_TO_VBEP -(FV45KFAK_VBEP_FUELLEN)
- USEREXIT_MOVE_FIELD_TO_VBKD (Business Data) – (FV45KFKD_VBKD_FUELLEN_TEIL_2)
- USEREXIT_NUMBER_RANGE -(MV45AF0B_BELEG_SICHERN)
Use this User Exit to define the number ranges for assigning an internal document number to the required fields. This user exit is used, for instance, if you want to set a range on the basis of the sales agency (VKORG) and the selling business (VKBUR).
- USEREXIT_PRICING_PREPARE_TKOMK (Hdr Strctr for Pricing) – FV45PF0P_PREISFINDUNG_VORBEREI
- USEREXIT_PRICING_PREPARE_TKOMP (Itm Strctr for Pricing) – FV45PF0P_PREISFINDUNG_VORBEREI
- USEREXIT_SAVE_DOCUMENT ß (MV45AF0B_BELEG_SICHERN)
- USEREXIT_MOVE_FIELD_TO_KOMKD (Header-Material Determination)
- USEREXIT_MOVE_FIELD_TO_KOMPD (Item-Material Determination)
- USEREXIT_MOVE_FIELD_TO_KOMKG (Header-Material Listing)
- USEREXIT_MOVE_FIELD_TO_KOMPG (Item-Material Listing)
- USEREXIT_CHECK_VBAP (Incompletion Check)
- USEREXIT_CHECK_VBKD (Incompletion Check-Business Data)
- USEREXIT_CHECK_VBEP (Incompletion Check, BOM Explosion-Schedule Line)
- USEREXIT_CHECK_VBSN (Incompletion Check-Serial Number)
- USEREXIT_MOVE_FIELD_TO_TVCOM_H (Text Determination for Header Texts)
- USEREXIT_MOVE_FIELD_TO_TVCOM_I (Text Determination for Item Texts)
- USEREXIT CUST MATERIAL READ (To place another customer number in the customer’s material data record (e.g. company hierarchy)
- USEREXIT_NEW_PRICING_VBAP (Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again)
- USEREXIT_NEW_PRICING_VBKD (Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again)
- USEREXIT_SOURCE_DETERMINATION (To determine which plant will be used for the delivery. In the standard system, the delivering plant is copied from the customer master or the customer-material info record. If you want to use a different rule, then you must enter it in this user exit))
- USEREXIT_MOVE_FIELD_TO_KOMK (Header-Free Goods Determination)
- USEREXIT_MOVE_FIELD_TO_KOMP (Item-Free Goods Determination)
USEREXIT_AVAIL_CHECK_CREDIT (This user exit allows you to determine whether the system should or should not carry out an availability check after a blocked document has been released or after a new credit check)
USEREXIT_CHANGE_SALES_ORDER (In the standard SAP R/3 System, the quantity and confirmed date of The sales contract schedule line is updated automatically if the purchasing request is issued and the sales record (e.g. amount, date) is updated. If you want to change this configuration in the standard system, you can define certain requirements to protect your sales orders from being changed automatically. Using the exit of this consumer for this reason. Decide at this stage if the timelines are to be changed)
Price Determination:Module pool SAPLV60A, Include RV60AFZZ:
- USEREXIT_PRICING_PREPARE_TKOMK (To copy additional fields for pricing in the TKOMK communication structure (header fields), which have not been provided in the standard SAP system)
- USEREXIT_PRICING_PREPARE_TKOMP (To copy additional fields for pricing in the TKOMP communication structure (item fields)
- Module pool SAPMV61A, Include MV61AFZA: USEREXIT_FIELD_MODIFICATION, USEREXIT_PRICING_CHECK & USEREXIT_CHANGE_PRICING_RULE
- Module pool SAPLV61A, Include RV61AFZA: USEREXIT_PRICING_RULE & USEREXIT_PRICING_COPY
Billing:Module pool SAPLV60A, Include RV60AFZZ:
- USEREXIT_NUMBER_RANGE, USEREXIT_ACCOUNT_PREP_KOMKCV & USEREXIT_ACCOUNT_PREP_KOMPCV
- Module pool SAPLV60A, Include RV60AFZC: USEREXIT_NUMBER_RANGE_INV_DATE & USEREXIT_FILL_VBRK_VBRP
- Module pool SAPLV61A, Include RV61AFZB: USEREXIT_PRINT_ITEM & USEREXIT_PRINT_HEAD
- Include RV60AFZD: USEREXIT_RELI_XVBPAK_AVBPAK, USEREXIT_NEWROLE_XVBPAK_AVBPAK & USEREXIT_NEWROLE_XVBPAP_AVBPAK
General Billing Interface:
- Includes RV60AFZA, RV60AFZB & RV60AFZC
- EXIT_SAPLVED4_001 to EXIT_SAPLVED4_006
- Include RV60FUS1: BILLING_SCHEDULE_DELTA, USEREXIT_MOVE_FIELD_TO_FPLT & USEREXIT_MOVE_FIELD_TO_FPLA
- Include RV60FUS2: USEREXIT_PRICING_PREPARE_TKOMX
- Include RV60FUS3: USEREXIT_DATE_PROPOSAL, Modification report for billing plan SDFPLA02, Additions to billing plan – SDVAX001 & Change billing plan dates – User exit V60F0001
Transfer to accounting:
Module Pool SAPLV60B:EXIT_SAPLV60B_001 to EXIT_SAPLV60B_011
User exit in Sap MM
The following SAP enhancements are available for the MM:
- AMPL0001-User sub-screen for additional AMPL data (manufacturer component number)
- LMELA002-Acceptance of the batch number from the notification of the shipment at the time of delivery of the products
- LMELA010-Incoming shipping notification: receipt of IDoc element data
- LMEQR001-User Exit for Source Identification M06B0001-Role Identification for Requirements Release
- M06B0001-Changes in the coordination system for the issuance of requests
- M06B0003-Area number and document number
- M06B0004-Scope of number and document number
- M06B0005-Changes in the contact system for the final release of the purchase request
- M06E0004-Changes in the contact system for the publication of the purchase document
- MELAB001-Generation of the projected delivery schedule: implementation through the production profile
- MEQUERY1-Enhancement of the text summary ME21N / ME51N
- MEVME001-Calculation of the maximum GR amount and over / under-delivery tolerances
- MM06E001-User exits for inbound EDI communications and outbound purchase documents
- MM06E003-Area number and record number
- MM06E004-Control of import data screens for purchase orders
- MM06E005-Customer areas for buying documents
- MEREQ001-Customer own data for purchase orders
- MM06E007-Change the requisition document when converting to POs
- MM06E008-Monitoring the contract goal value for release orders
- MM06E009-Relevant text for “exi text
- MMAL0002-Distribution of the ALE source list: inbound processing
- MMAL0003-ALE Purchase Data Distribution Record: Outbound Processing
- MMAL0004-ALE Purchase Data Distribution Record: Inbound Delivery
- MMDA0001-Default values for the address of delivery
- MMFAB001-User exit for release generation
- MRFLB001-Control objects during release
- LWBON001-Enhancement of the LIS update through the extension of the MCKONA contact system (business volumes and rebate revenue)
- LWBON003-Change the settlement details for the end-of – period refund settlement prior to the production of settlement documents
- LWSUS001-Determination of the customer-specific source in Retail
- LMEXF001-Conditions for buying documents
User exit in Sap FICO
The following SAP enhancements are available for the FI
- F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user defined IDoc section
- F0500S002 FIDCC1: Update IDoc / Do not submit
- F0500S003 FIDCC2: Switch IDoc / Do not submit
- F0500S004 FIDCMT, FIDCC1, FIDCC2: change outbound IDoc / do not send.
- F0500S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: modify the FI document
- F0500S006 FI Outgoing IDoc: Reset clearing in FI Document
- F0500S007 FIDCCH Outbound: IDoc Impact for Record Switch
- F1800A001 Balance sheet adjustment
- FARC0002 Enhanced Archiving Tests for MM Vendor Master Data
- RFAVIS01 User Exit to Changing Payment Assistance Segment Text
- RFEPOS00 Line View item: check the selection conditions
- Automatic communications of RFKORIEX
- SAPLF051 FI workflow (pre-capture, release)
You may also , refer to SAP Note 381348, “Using User Exit, Customer Exit, VOFM in SD.”
Now follow these tutorial links to learn more about SAP related topic !
- Available to Promise (ATP) in SAP
- Replenishment lead time (RLT)
- SAP Sales Integration with other Modules
- SD Advanced Pricing
- SAP S/4HANA
- SAP Fiori App
- SAP Fieldglass
- SAP Customer Engagement & Commerce Suite(CEC Suite)
- Hybris Marketing
- Third-Party Sales in SAP