ERPClimb logoERPClimb

SAP ABAP User Exits Interview Questions

Interviewers use user exits to test depth rather than coverage: the follow-up question is almost always "why does the system behave that way?", and that is where prepared answers usually run out.

Master classic SAP user exits in SD/MM flows with MV45AFZZ, MV50AFZ1, RV60AFZZ, debugging, safe save logic, performance control and S/4HANA migration thinking.

This page carries 20 reviewed SAP ABAP user exits interview questions, each with a complete written answer and no sign-in required. The set breaks down into 3 foundational, 11 mid-level and 6 advanced questions, so you can start at the top for a first interview or skip ahead to the scenario-based items for a senior round.

If you can handle every question here without hesitating, user exits is unlikely to be what costs you an SAP ABAP interview — and the same reasoning pattern transfers to the neighbouring topics linked at the bottom of this page.

20 User Exits questions with answers

easyUser Exits

1. Difference between USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT.

PREPARE runs before database update — use for validations that must stop the save. SAVE_DOCUMENT runs during the save — used to update related data with the transaction context.
easyUser Exits

2. A header-level check in a sales order user exit read VBAP and gave wrong results for orders with several items. Why, and what should it use?

In SAPMV45A, VBAP is a work area holding the item currently or last processed — in a header-level exit such as USEREXIT_SAVE_DOCUMENT_PREPARE it contains just one item, often the last one. The full item list is in the internal table XVBAP (new state, with UPDKZ I/U/D) and YVBAP (old state in change mode). The check must loop over XVBAP, skipping deleted items (UPDKZ = 'D'), and evaluate each item or aggregate them. I would also add a guard on order type and T180-TRTYP, and keep the logic in a Z FORM or class for testing.
easyUser Exits

3. A validation must run before the sales order is saved. How do you find and confirm the right user exit?

I identify the main program (System → Status: SAPMV45A), check SPRO → SD → System Modifications → User Exits documentation, and search the program and includes for PERFORM USEREXIT_. The candidate for checks before saving is USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ. I confirm it by debugging VA01/VA02 with a breakpoint in the FORM: it runs once before save, and VBAK, XVBAP and XVBPA contain the final data. An error message there stops saving and is returned in RETURN for BAPI calls. I also test copying, mass change and IDoc/BAPI paths.
mediumUser Exits

4. How do you confirm whether a user exit is triggered at the correct point?

I debug the exact business action, set a breakpoint in the exit routine, check the call stack, inspect available global structures and confirm whether the exit is called before or after the required data is available.
mediumUser Exits

5. User exit code is not being executed after transport. Why?

The include may not have been transported with the exit's code; the modification adjustment (SPAU) after upgrade may have overwritten it; or the SSCR key was not applied and code was reverted. Check version history in SE38.
mediumUser Exits

6. A validation in MV45AFZZ is blocking all order types, but it should run only for one order type. What is the issue?

The user exit is missing proper guard conditions. Logic inside MV45AFZZ can run for multiple sales orgs, order types and process flows. The validation should check values like VBAK-VKORG and VBAK-AUART before executing custom logic.
hardUser Exits

7. Why is SELECT inside LOOP dangerous in user exits?

User exits often run during critical transaction save or post processing. SELECT inside LOOP creates repeated database calls and can slow down VA01, VA02, VL01N, VL02N or billing jobs. The better design is to collect unique keys, select data once and use internal table lookup.
hardUser Exits

8. How would you handle user exits during S/4HANA conversion?

I would inventory all user exits, understand the business purpose, check whether the logic is still required, identify released BAdI or clean-core alternatives, extract reusable logic into service classes and perform regression testing for impacted processes.
mediumUser Exits

9. A save exit read material master data once for every sales order item. What is the impact and how do you optimise it?

For orders with many items and for mass processing (EDI, BAPIs), per-item SELECTs multiply: the same materials are read repeatedly, and response time grows with item count. ST05 would show many identical SELECTs. Optimisation: guard first; then use data already in XVBAP (many material attributes like MATKL are copied into the item); if more is needed, read all materials of the document once with FOR ALL ENTRIES into a hashed table and look up per item. For repeated saves, buffer per document. Measure with ST05/SAT before and after.
mediumUser Exits

10. A billing exit added a custom reference to F2 invoices, but the reference is missing on invoices from VF04 and on credit memos it should not appear. How do you fix and design this?

First check where the value is set: USEREXIT_FILL_VBRK_VBRP in RV60AFZZ runs during billing creation, but the code may depend on data only available in dialog or may lack a guard on billing type. The fix: guard on VBRK-FKART (F2 only), take the source value from reference data available in background (order header/delivery), and do not rely on screen fields. Better still, check whether a data transfer routine (VOFM) in copy control for F2 can copy the value — it is configured per billing type and runs in VF01 and VF04 identically. I test VF01, VF04 and billing jobs, and credit memos.
mediumUser Exits

11. A new validation in a user exit was activated globally instead of only for the pilot sales organization. How should exit logic be controlled to avoid this?

The logic lacked an activation control. I would add guard conditions driven by configuration: a Z customizing table (feature, VKORG, active flag), read once and buffered, checked at the start of the exit. For the pilot, only the pilot sales org is active; later waves are activated by customizing transports without code changes. The immediate fix is to add the guard and transport it urgently, or temporarily deactivate the flag. I would also review other exit logic for similar global activation and include "activation scope" in the code review checklist.
mediumUser Exits

12. A compliance validation in MV45AFZZ worked in VA01 but unexpectedly blocked returns and credit memo requests. What went wrong and how do you fix it?

The validation lacked guard conditions. USEREXIT_SAVE_DOCUMENT_PREPARE runs for all sales document types handled by SAPMV45A — orders, returns, credit/debit memo requests, contracts, quotations. Without checking the document category (VBAK-VBTYP) or order type (AUART), the rule applied everywhere. Fix: add guards at the top (e.g. CHECK vbak-vbtyp = 'C' for orders, or a list of AUART values from a Z customizing table), plus CHECK t180-trtyp <> 'A'. Then retest all document types and document which ones the rule covers.
mediumUser Exits

13. A batch validation was meant for LF deliveries only but was applied to all delivery types, including returns. How do you correct the MV50AFZ1 logic?

The exit runs for every delivery type processed by SAPMV50A — outbound, returns, replenishment. The validation needs a guard such as CHECK likp-lfart = 'LF' (or a customizing list) at the start of USEREXIT_SAVE_DOCUMENT_PREPARE. Inside, the batch logic should consider only main items (UECHA initial) and accept batch split sub-items, and skip deleted items. I would test VL01N/VL02N, VL10 background creation and IDoc-created deliveries, plus returns to confirm they are no longer blocked.
mediumUser Exits

14. A delivery save validation works in VL02N but fails during background delivery processing. What would you check?

I would check whether the same exit is triggered in background, compare manual and background data availability, check delivery type and item category conditions, check background user authorization and avoid frontend-dependent or dialog-only logic.
mediumUser Exits

15. You must prevent saving sales orders without a purchase order reference. Where?

Add the check in USEREXIT_SAVE_DOCUMENT_PREPARE (or the SD BAdI equivalent) so an error message stops the save before COMMIT. Perform the check on VBAK/VBKD fields available at that point.
mediumUser Exits

16. What is the difference between USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT in sales order processing?

USEREXIT_SAVE_DOCUMENT_PREPARE is commonly used before save for validations and preparation logic. USEREXIT_SAVE_DOCUMENT is called later in the save process. The exact behavior should be confirmed by debugging because timing and available data matter.
hardUser Exits

17. How do you regression test a user exit before upgrade?

Create an ABAP Unit test around the service class the exit delegates to; run scripted transactions via eCATT/CBTA; add SPAU_ENH review to the release checklist; capture screen input via SM12/SM13 as regression cases.
hardUser Exits

18. How do you inventory user-exit usage before S/4HANA conversion?

Extract lists via SCI/ATC or reports like RSMODPRF, RSMODCHK, or use SUM tools. Categorise each by module, purpose, owner, and whether a released BAdI exists. Prioritise migration for exits without a BAdI equivalent.
hardUser Exits

19. User exit added to fix a data issue and now blocks legitimate orders. How do you respond?

Analyse via SM13/ST22 dumps, deactivate temporarily via transport (never manually), add tighter conditions to the check, add regression tests, and document root cause and fix for the change advisory board.
hardUser Exits

20. In an S/4HANA program, the team plans to migrate all MV45AFZZ logic to BAdIs at once. What is your advice?

I would not do a big-bang migration. First inventory the exit per requirement: still needed, covered by standard/configuration, available as released BAdI or key user extension? Then refactor: move each requirement into a class, still called from the exit, with tests. Requirements with a suitable released BAdI (same timing, same data) are then switched to the BAdI implementation, removing the code from the exit in the same transport. Where SAP offers no equivalent BAdI (common in save logic), the exit remains as tier 3 with documentation. Each step is regression-tested across VA01, BAPIs, IDocs and Fiori.

Related lesson

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

Related topics

Next practice step

Go deeper on this topic