SAP ABAP Enhancements: User Exits, Customer Exits and BAdIs

Prajakta Sawant · 31 January 2025 · 3 min read

The four ways to add your own logic to standard SAP without modifying it: user exits, customer exits, BAdIs and the enhancement framework, and which one to pick on S/4HANA.

Every SAP project meets a requirement the standard does not cover: an extra check before a sales order is saved, a default value on a screen, a field SAP does not fill. Enhancements let you add that logic at points SAP has prepared, without changing SAP's own code, so your work survives upgrades and support packages far better than a modification.

User exits

User exits are empty subroutines ( FORM USEREXIT_... ) that SAP ships inside its own includes, mostly in SD. The classic example is include MV45AFZZ in sales order processing, whose routine USEREXIT_SAVE_DOCUMENT_PREPARE is the usual place for checks just before an order is saved.

Because the include belongs to SAP, changing it needs an access key for the object. You will still find user exits in older systems, but new logic belongs in a BAdI when one exists.

Customer exits

Customer exits are hooks SAP placed in its standard programs. You look them up in SMOD and implement them in a project in CMOD . There are four kinds:

• Function module exits : the standard program runs CALL CUSTOMER-FUNCTION '001' , which calls a function module named EXIT_<program>_001 . Your code goes into its Z include ( ZX... ).

• Menu exits : add your own entries to standard menus.

• Screen exits : add fields in subscreen areas SAP has reserved.

• Field exits : obsolete; do not build new ones.

The code runs only after the CMOD project is activated. To find candidates, search the standard program for CALL CUSTOMER-FUNCTION .

BAdIs

A Business Add-In is an object-oriented exit: SAP defines an interface and you implement its methods in your own class.

• Find the BAdI. For classic BAdIs, set a breakpoint in method GET_INSTANCE of class CL_EXITHANDLER and run the transaction; for new BAdIs, look for the GET BADI statement.

• Display the definition in SE18 : its interface, methods, and whether it is multiple-use or filter-dependent.

• Create the implementation in SE19 . A new BAdI lives in an enhancement spot, so its implementation sits inside an enhancement implementation.

• Write your logic in the implementing class's methods and activate the implementation.

A multiple-use BAdI can have several active implementations at the same time; a filter-dependent BAdI runs only the implementations whose filter value matches, for example a country.

Enhancement framework

• Implicit enhancement points exist at the start and end of every subroutine, function module and method, with no preparation by SAP. In the ABAP editor, Edit > Enhancement Operations > Show Implicit Enhancement Options displays them.

• Explicit enhancement points and sections are places SAP marked with ENHANCEMENT-POINT and ENHANCEMENT-SECTION ; a section lets you replace a block of standard code.

• Global class methods accept pre-, post- and overwrite methods.

Which one to choose today

On S/4HANA, look for a BAdI first, then an explicit enhancement point, and use an implicit enhancement only when nothing else fits. In ABAP Cloud (SAP BTP ABAP environment, S/4HANA Cloud, or clean-core development on premise) only released BAdIs can be implemented, in ADT; user exits, customer exits and implicit enhancements are not available there.

Key takeaways

• Enhancements add logic at prepared points; modifications change SAP's code.

• User exits need an object access key; customer exits run through an active CMOD project.

• SE18 shows a BAdI definition, SE19 holds your implementation.

• A breakpoint in CL_EXITHANDLER=>GET_INSTANCE reveals classic BAdIs.

• For clean-core and cloud work, only released BAdIs count.

Want to implement exits and BAdIs on a real system with a trainer? See our SAP ABAP Development course .