Difference Between User Exit and Customer Exit in SAP

โšก Smart Summary

User Exits and Customer Exits in SAP ABAP are enhancement hooks that add custom functionality to standard programs without modifying SAP code. This page explains customer exit types, worked examples, the SMOD and CMOD transactions, user exits, and how the two techniques differ.

  • ๐Ÿช Core Definition: A customer exit is a hook placed by SAP inside a standard program, screen, or menu on which a customer hangs custom logic.
  • ๐Ÿงฉ Three Exit Types: Function module exits add code, screen exits add fields through a subscreen, and menu exits add items to a pulldown menu.
  • ๐Ÿ” Locating Exits: Transaction SMOD lists the available exits, and SE81 browses them by application area.
  • ๐Ÿ› ๏ธ Implementation: A project is created in CMOD, the exit is assigned to it, the code is written, and the project is activated.
  • ๐Ÿ“ฆ User Exit: A user exit serves the same purpose but exists only in the SD module, with MV45AFZZ as the best known example.
  • โš–๏ธ Choosing a Technique: User exits are SD subroutines, customer exits are cross module and upgrade safe, and a BAdI is the object oriented successor to both.

User Exit and Customer Exit in SAP

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…

The key benefit is that the standard SAP object is never modified. The custom code sits in a reserved include or subscreen that SAP calls at the right moment, so the enhancement survives a system upgrade instead of being overwritten. Because of this, exits belong to the family of SAP enhancement techniques together with the newer Business Add-In.

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'

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

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 )

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.

Examples of Customer Exits

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

Examples of Customer Exits

AFTER

Examples of Customer Exits

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

Examples of Customer Exits

AFTER

Examples of Customer Exits

Locating Customer Exits

In transaction SMOD and look into the details-

Locating Customer Exits

Or in transaction SE81 you can use the appropriate application area

Locating Customer Exits

Create a Customer Exit

To create a customer exit you first need to create a project in transaction CMOD

Create a Customer Exit

Later you assign the Customer Exit to your project.

The full sequence from finding the exit to activating the code is short, and it always follows the same six steps.

  1. Find the enhancement: Locate the enhancement name in SMOD, for example the component EXIT_SAPMF02K_001 for the vendor master.
  2. Create the project: In CMOD, enter a project name that begins with Z or Y and choose Create.
  3. Assign the enhancement: On the Enhancement assignments screen, add the enhancement name that contains the exit.
  4. Write the code: Open the function module exit and place the code inside its reserved include, which begins with ZX.
  5. Handle screen and menu parts: For a screen exit, build the CUSTSCR subscreen, and for a menu exit, fill the +CUS function code in the GUI status.
  6. Activate the project: Activate the project in CMOD so the exit is called at runtime. Without activation, the code is ignored.

๐Ÿ’ก Tip: The include of a function module exit begins with ZX, so it is transported with the project. Never place the custom logic directly in the SAP function module, because that would be a modification, not an enhancement.

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

A user exit is technically a subroutine (a FORM) inside an SAP include, so it is edited directly and requires an access key. This is the main practical difference from a customer exit, summarised in the next section.

User Exit vs Customer Exit

Both techniques add custom behaviour to standard SAP, but they differ in scope, technology, and how upgrade safe they are. The table below compares them.

Criteria User Exit Customer Exit
Availability SD module only Across all SAP modules
Technique Subroutine (FORM) in an SAP include such as MV45AFZZ Function module, screen, or menu exit managed in SMOD and CMOD
Access key Requires a modification access key No access key needed
Upgrade behaviour Must be checked in the upgrade with SPAU Upgrade safe, called from a reserved include
Managed by Edited directly in the include Activated through a CMOD project

Customer exits are the safer and more general of the two. For enhancements that neither exit can reach, SAP later introduced the Business Add-In.

Customer Exits vs BAdI

A Business Add-In (BAdI) is the object oriented successor to the customer exit. Instead of a reserved include, a BAdI defines an interface, and the custom logic sits in a class that implements it. This brings two advantages that a customer exit does not offer.

  • Multiple implementations: A multiple use BAdI allows several independent implementations of the same enhancement, while a customer exit allows only one.
  • Object orientation: A BAdI works with methods and classes, so it fits modern ABAP Objects development and is easier to filter by country or business scenario.

The practical rule is simple: use an existing customer exit or user exit when the enhancement point already exists, and use a BAdI when a new, reusable enhancement point is required.

FAQs

SMOD displays the SAP enhancements and the components inside them. CMOD groups one or more enhancements into a customer project, assigns the code, and activates it. SMOD is for viewing, CMOD is for implementing.

No. A customer exit is an enhancement, not a modification, so no access key is needed. A user exit is edited directly in an SAP include and therefore does require a modification access key.

Run the transaction, open System then Status to read the program name, then search the enhancements of that program in SMOD or SE81. A common shortcut is to search table MODSAP for the program’s function group.

AI assistants in ABAP development tools read the program name and suggest the relevant enhancement, exit, or BAdI, and explain what each one changes. The developer still confirms the choice and writes the logic inside the reserved include.

AI advisors weigh whether an enhancement point already exists and how many implementations are needed, then usually recommend a BAdI or an enhancement spot for new work, keeping classic exits for points that only exist as exits.

Summarize this post with: