ERPClimb logoERPClimb
User Exits
ABAP Developmentintermediate 8 min read

User Exits Part 2: User Exits vs Customer Exits vs BAdIs — When to Migrate

Preview · a free account unlocks the full lesson

Key takeaway

Compare user exits, customer exits (SMOD/CMOD) and BAdIs by interface, number of implementations, testability and upgrade safety, and decide when existing user-exit logic should stay and when it should move to a BAdI or class-based design.

In this lessonShow sections

Visual overview

User Exits Part 2: User Exits vs Customer Exits vs BAdIs — When to Migrate — learning sheetFlow: SMOD: display enhancement V45A0002 and its components → Compare MV45AFZZ USEREXIT_SAVE_DOCUMENT_PREPARE with an available sales BAdI in your release (timing, parameters) → Write a migration decision for one exit using the criteria above. Key ideas: CUSTOMER EXITS IN BRIEF; COMPARISON; WHEN TO KEEP A USER EXIT; WHEN TO MIGRATE OR REFACTOR. Watch out: Moving logic to a BAdI that runs at a different time or with less data can change behaviour — compare carefully.ERPClimb.com / ABAP / LESSON 2/8 / LEARNING SHEETUser Exits Part 2: User Exits vs Customer Exits vs BAdIs —When to Migrate1 · HOW IT FLOWS1SMODdisplay enhancement V45A0002 andits components2Compare MV45AFZZUSEREXIT_SAVE_DOCUMENT_PREPAREwith an available sales…3Write a migrationdecision for one exitusing the criteria above2 · KEY IDEAS EXPLAINEDCustomer Exits In BriefSAP code: CALL CUSTOMER-FUNCTION '001' → FMEXIT_SAPMV45A_001 (example pattern).SMOD: shows enhancements and components (functionexits, screen exits, menu exits).ComparisonData access: user exit — all globals; customerexit — parameters only; BAdI — parameters/objectsonly.Implementations: user exit — one code block;customer exit — one project; BAdI — one or many,with filters.When To Keep A User ExitSAP offers no BAdI at that point (common in SDsave logic).Logic is small, documented and stable.When To Migrate Or RefactorThe exit contains hundreds of lines from severalprojects.A released BAdI for the same purpose exists (checkin S/4HANA).3 · REMEMBER · WATCH OUTRememberUser exits: FORMs with full access to global data; customer exits:function modules with fixed parameters; BAdIs: interfaces with…Migration is worth it when an exit is overloaded, hard to test, sharedby many teams or blocks clean-core goals.Often the best first step is refactoring: keep the exit as entry pointand move the logic into classes.!Watch outMoving logic to a BAdI that runs ata different time or with less datacan change behaviour — comparecarefully.4 · IN A REAL PROJECTMV45AFZZ in a global template had grown to 3,000 lines from seven projects, and every change needed a full SDregression test. The team did not migrate everything at once: they moved each requirement into a class, calledfrom the same exit, with unit tests. When the company moved to S/4HANA, five of the classes were connected to…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 1 of this series introduced user exits; before diving into specific includes, it's worth comparing all three enhancement technologies you'll meet — user exits, customer exits, and BAdIs. A user exit is a FORM with full access to global data; a customer exit is a function module with fixed parameters; a BAdI is an interface implemented by classes, with filters and support for multiple implementations.

Customer exits, briefly: SAP's code calls CALL CUSTOMER-FUNCTION '001', which calls a function module such as EXIT_SAPMV45A_001 as an example pattern. SMOD shows the enhancement and its components — function exits, screen exits, menu exits. CMOD holds your own project, and your code goes into the ZX… include inside the exit function module, which you then activate as part of that project; only one project can use a given enhancement at a time.

Comparing the three directly: on data access, a user exit sees all global data, a customer exit only sees its parameters, and a BAdI only sees its parameters or objects.

On implementations, a user exit is a single code block, a customer exit is a single project, and a BAdI can have one or many implementations, with filters to control which one runs. On testability, a user exit is hard to test, a customer exit is medium, and a BAdI is good, because it's built from classes.

On upgrade stability, all three are stable, but BAdIs are the cleanest, while user exits need an access key to touch at all. In S/4HANA, all three technologies still exist on-premise, but released BAdIs are the clean-core option.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.