Enhancements Part 9: Performance and Safety in Enhancements
Preview · a free account unlocks the full lesson
Write enhancement code that never harms the standard process: no COMMIT/ROLLBACK, no dialogs in background, correct messages, buffered reads instead of SELECTs per item, guard conditions, exception handling, and how to test and monitor enhancements (ST05, SAT, ST22).
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 through 8 of this series were about choosing and implementing enhancements; this lesson makes sure they don't break or slow down standard processes once they're in place.
Transaction consistency comes first: SAP saves the document at the end of its own logical unit of work (LUW), and a COMMIT issued from your own code can write half-finished data or break that update entirely. Never call a BAPI that commits, CALL TRANSACTION, or SUBMIT AND RETURN with commits from inside a save exit. For any additional database changes of your own, use update function modules called IN UPDATE TASK, or PERFORM … ON COMMIT, so they get saved together with SAP's own commit.
On messages and dialogs: error messages of type E belong in validation exits, such as USEREXIT_SAVE_DOCUMENT_PREPARE or a checking BAdI method — used anywhere else, they can terminate processing unexpectedly. Never use POPUP_TO_CONFIRM or show screens when sy-batch = 'X' or inside an update task, since in BAPIs and IDocs there's no user present at all, so messages must be returned rather than displayed.
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
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
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.