All topics
ABAPIntermediate

User Exits

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

Overview

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

Lessons in this topic

  • User Exits Part 1: What SD User Exits Are and How They WorkUnderstand classic SD user exits: FORM routines in SAP includes like MV45AFZZ, MV50AFZ1 and RV60AFZZ, why they need a one-time access key, which global data they see, how they differ from customer exits (CMOD), and the basic rules for writing code in them.
  • User Exits Part 2: User Exits vs Customer Exits vs BAdIs — When to MigrateCompare 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.
  • User Exits Part 3: Finding User Exits in Real TransactionsFind the right user exit for a requirement: identify the main program, search for PERFORM USEREXIT and CALL CUSTOMER-FUNCTION, use SPRO "System modifications" documentation, debug with breakpoints on the exit FORMs, and verify timing and data in all processing paths.
  • User Exits Part 4: MV45AFZZ — Sales Order Exits and Save LogicUse the main sales order exits correctly: USEREXIT_MOVE_FIELD_TO_VBAK/VBAP/VBKD for defaults, USEREXIT_SAVE_DOCUMENT_PREPARE for checks and final changes, USEREXIT_SAVE_DOCUMENT for own tables, custom fields via VBAK/VBAP appends, and working with XVBAP/YVBAP and UPDKZ.
  • User Exits Part 5: MV50AFZ1 — Delivery User Exit PatternsApply delivery user exits in MV50AFZ1: USEREXIT_SAVE_DOCUMENT_PREPARE for checks and changes with LIKP and XLIPS, USEREXIT_SAVE_DOCUMENT for own tables, batch split items, background delivery creation (VL10) and when the BAdI LE_SHP_DELIVERY_PROC is the better choice.
  • User Exits Part 6: RV60AFZZ — Billing User Exit PatternsUse billing exits correctly: RV60AFZZ FORMs such as USEREXIT_FILL_VBRK_VBRP and USEREXIT_NUMBER_RANGE, RV60AFZC for account determination and invoice split, copy control data transfer routines (VOFM), and designing billing logic for large VF04 runs.
  • User Exits Part 7: Safe Coding Rules Inside User ExitsProtect standard processes when coding in user exits: guard conditions, transaction type and processing mode checks, correct message types, no COMMIT/ROLLBACK/CALL TRANSACTION, no popups in background, careful handling of global data, namespaces for own variables and code organisation in Z includes.
  • User Exits Part 8: Performance Risks in User ExitsFind and fix performance problems caused by user exits: how often SD exits run, SELECTs in item loops, repeated reads of the same master data, reading reference documents, buffering per document, and measuring with ST05 and SAT in mass processing (VL10, VF04, BAPIs).

Interview questions covered

  • How do you regression test a user exit before upgrade?
  • How do you confirm whether a user exit is triggered at the correct point?
  • Difference between USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT.
  • User exit code is not being executed after transport. Why?
  • A validation in MV45AFZZ is blocking all order types, but it should run only for one order type. What is the issue?
  • How do you inventory user-exit usage before S/4HANA conversion?
  • Why is SELECT inside LOOP dangerous in user exits?
  • What is a user exit?
  • User exit added to fix a data issue and now blocks legitimate orders. How do you respond?
  • How would you handle user exits during S/4HANA conversion?
  • Are user exits considered modifications?
  • A save exit read material master data once for every sales order item. What is the impact and how do you optimise it?
  • In an S/4HANA program, the team plans to migrate all MV45AFZZ logic to BAdIs at once. What is your advice?
  • 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?
  • 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?
  • 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?
  • 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?
  • A validation must run before the sales order is saved. How do you find and confirm the right user exit?
  • 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?
  • How do you make a legacy user exit maintainable?

Related topics

Interview questions on this topic