ERPClimb logoERPClimb
AMDP
RAP / CDS / ODataadvanced 8 min read

AMDP Part 5: Debugging, Testing and Performance Analysis

Preview · a free account unlocks the full lesson

Key takeaway

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 sections

Visual overview

AMDP Part 5: Debugging, Testing and Performance Analysis — learning sheetIn one line: 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.ERPClimb.com / RAP / LESSON 5/6 / LEARNING SHEETAMDP Part 5: Debugging, Testing and Performance Analysis1 · IN ONE LINETroubleshoot AMDP across two runtimes: debug SQLScript in ADT, analyze runtime errors, testAMDP logic with ABAP Unit, and find performance bottlenecks with SQL trace and HANA plananalysis.2 · KEY IDEAS EXPLAINEDThe AMDP DebuggerOpen the AMDP class in ADT and set a breakpoint ona line inside the SQLScript (the debugger must beenabled for AMDP in your user settings/system —…Run the ABAP caller; the debugger stops inSQLScript.Runtime ErrorsErrors in SQLScript (division by zero, conversionerrors, missing objects) raise exceptions such asCX_AMDP_EXECUTION_ERROR in ABAP; uncaught, they…Catch them in the caller where meaningful, and logwith context (input parameters).TestingTest the AMDP through its ABAP method with ABAPUnit.Isolate data: depending on release, test doublesfor AMDP dependencies are limited; practicaloptions are dedicated test data in a test client…Performance AnalysisST05 (SQL trace): the call of the procedure andits statements, runtime and rows.SAT (ABAP profiling): share of time in the AMDP vsABAP.3 · DO · AVOIDBest practice!Common mistakeUse the ADT AMDP debugger and inspect tablevariables.Catch and log AMDP exceptions with inputcontext.Test AMDP via ABAP Unit, compare with ABAP SQLreferences.✕Debugging only on the ABAP side.✕Not logging input parameters of failing AMDPcalls.✕Letting CX_AMDP exceptions dump withoutcontext.4 · IN A REAL PROJECTA nightly job calling an AMDP dumped once a week with a conversion error. The dump showed only the HANAmessage. The team captured the input parameters in an application log before the call and reproduced thefailing case in QAS within an hour. In the AMDP debugger, the table variable showed one item with a malformed…Original ERPClimb learning sheet • Verify against your SAP release and edition

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.

Free account

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

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.