AMDP Part 5: Debugging, Testing and Performance Analysis
Preview · a free account unlocks the full lesson
Troubleshoot AMDP across two runtimes: debug SQLScript in ADT, analyze runtime errors, test AMDP logic with ABAP Unit, and find performance bottlenecks with SQL trace and HANA plan analysis.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Parts 1 through 4 built correct AMDPs. When something goes wrong, the work spans both ABAP and HANA, and this part gives the method and the tools for that.
ADT has a dedicated AMDP debugger. Opening the AMDP class and setting a breakpoint on a line inside the SQLScript (the debugger has to be enabled for AMDP in user settings or the system — ADT prompts for this on first use) lets you run the ABAP caller and have the debugger stop right inside the SQLScript. From there you can inspect scalar variables and table variables, such as lt_items, including their row counts and contents, and step through statements to see exactly which step produces the unexpected data.
Runtime errors in SQLScript — division by zero, conversion errors, missing objects — raise exceptions such as CX_AMDP_EXECUTION_ERROR in ABAP, and if left uncaught, they dump (visible in ST22) carrying the HANA error text. These should be caught in the caller where it makes sense, and logged with context such as the input parameters. Activation errors — syntax problems, a missing USING, a type mismatch — show up directly in ADT instead.
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
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.