How to implement screen exits, user exits and BAdIs in SAP ABAP
To implement a screen exit in classic SAP ABAP, you find the SAP enhancement that offers it (SMOD), create a CMOD project, build the customer subscreen and move data between the SAP program and your subscreen through the enhancement's function exits. User exits and BAdIs follow the same idea: SAP-provided hooks where your code runs without modifying standard code. In S/4HANA, check key user extensibility and released BAdIs first, because classic screen exits are not available in Fiori apps.
When this makes sense
- Users need extra fields on a standard SAP screen such as a purchase order or sales order header
- Business rules must run at save or check time in a standard transaction without modifying SAP code
- Your system has years of user exits and modifications and you want them reviewed or rebuilt as BAdIs
- You are moving to S/4HANA and need to know which exits survive and what replaces screen exits in Fiori
- A developer implemented an exit but the screen fields stay empty or values are not saved
What the engagement covers
Finding the right hook
Searching enhancements in SMOD and BAdI definitions in SE18, enhancement spots in SE80, and tracing calls of CALL CUSTOMER-FUNCTION, CALL CUSTOMER-SUBSCREEN and GET BADI in the standard program.
Screen exit build
Creating the customer subscreen in the exit function group, laying out fields in the screen painter, and writing PBO and PAI modules.
Data transport between program and screen
Passing data from the SAP program into the function group through the export function exit, keeping it in global data of the function group so screen fields with matching names are filled, and returning user input through the import function exit.
Custom fields in tables
Appending customer fields to standard tables through append structures or customer includes (for example CI_ includes), and making sure they are saved by the standard update.
User exits and BAdIs
Function exits in CMOD projects, form-based user exits in includes such as the sales order MV45AFZZ, classic and new BAdIs implemented in SE19, and implicit or explicit enhancement points.
S/4HANA alternatives
Key user extensibility with the Custom Fields and Custom Logic apps, released BAdIs for ABAP Cloud, and side-by-side extensions on SAP BTP where in-app options do not fit.
How it runs
- 1
Requirement and hook search (2-5 days)
- Confirm the business field or rule
- Find available exits, BAdIs and enhancement spots
- Choose the least invasive option
- 2
Design (2-5 days)
- Define table extensions and data flow
- Specify screen layout and validation
- Plan authorisation and change documents if needed
- 3
Build and unit test (1-3 weeks)
- Activate CMOD project or BAdI implementation
- Build subscreen and exit logic
- Test create, change and display modes
- 4
Integration test and transport (1-2 weeks)
- Test with related processes, printing and interfaces
- Run ATC checks
- Transport and verify in production
What you get
- Enhancement decision note: chosen hook and alternatives considered
- Activated CMOD project or BAdI implementation with transport
- Table extension and screen design documentation
- Unit and integration test evidence for create, change and display
- S/4HANA compatibility note for each enhancement
What drives cost and effort
| Availability of a standard hook | When SAP provides a screen exit or BAdI, the work is small; without one, options become modifications or redesign. |
| Number of screens and modes | Fields that must work in create, change and display, and in related transactions, multiply testing. |
| Downstream use of the field | Fields that flow to output forms, IDocs, BW or reports add extension work in each place. |
| Existing enhancements | Exits that already hold many changes from several developers need careful regression testing. |
| Target platform | S/4HANA with Fiori apps may need key user or BTP extensions instead of a classic screen exit. |
Fixed price per enhancement
Clear field or rule requirements where a standard hook exists.
Time and materials with a cap
Enhancements in heavily customised areas or where the hook still has to be found.
Enhancement review and remediation
Systems with many legacy exits and modifications being prepared for S/4HANA.
Questions to ask any SAP consultant
Which hook will you use, and what alternatives did you reject?
A developer who checks BAdIs and enhancement spots before reaching for a modification keeps upgrades cheap.
How will the new field behave in display mode and in change documents?
Fields that are editable in display mode or not tracked in change history are common defects.
Where else does this field need to appear?
Forms, interfaces and reporting often need the field too, and missing them causes rework.
Will this enhancement work in S/4HANA and Fiori?
Classic screen exits do not appear in Fiori apps, so plan the long-term option now.
How do you test exits that many processes share?
A change in a busy user exit can affect unrelated order types or plants.
Score candidate partners side by side with the free Implementation Partner Scorecard
Where these projects go wrong
Screen fields that show but are not saved
Make sure the import function exit passes values back and the customer include is part of the table the standard update writes.
Using a modification where an exit existed
Search SMOD, SE18 and enhancement spots first and record the search in the design note.
Side effects in shared user exits
Restrict logic by document type, organisation or transaction and regression test the main variants.
Enhancements that block S/4HANA adoption
Tag each enhancement with its S/4HANA status and prefer released BAdIs for new work.
Many screen exits are well documented in SAP notes and community answers, and an internal ABAP developer can implement a single field addition in a few days. Bring in help when the hook is unclear, the area is heavily customised, the field must flow through many processes, or you are planning S/4HANA and want enhancements built in a way that survives it. In S/4HANA, try the Custom Fields app before writing any code at all.
Frequently asked questions
What is the difference between a user exit and a screen exit?
A user exit, or function exit, lets you add ABAP logic at a point SAP defines. A screen exit lets you add your own subscreen with fields to a standard screen. Both are delivered as components of SAP enhancements and activated through a CMOD project.
How is data passed between the SAP program and a screen exit?
The enhancement usually provides an export function exit that hands data from the SAP program to the exit function group, where you store it in global variables used by your subscreen. An import function exit returns the user's input to the SAP program so it can be saved.
How do I find which exits a transaction offers?
Find the program name from the transaction, then search it for CALL CUSTOMER-FUNCTION, CALL CUSTOMER-SUBSCREEN and GET BADI, or check the package of the program in SMOD and SE18. Debugging with a breakpoint on these statements also shows what is called.
Are screen exits supported in S/4HANA?
They still run in SAP GUI transactions in S/4HANA on-premise, but they are not shown in Fiori apps. For Fiori, use key user extensibility, released extension points or side-by-side extensions.
Should new enhancements use BAdIs instead of user exits?
Where both exist, BAdIs are usually preferred: they support multiple implementations, filters and an object-oriented design. Released BAdIs are also the route for ABAP Cloud in S/4HANA.