Section 11 of 11

Debugging and Error Handling

Starting the debugger and the kinds of breakpoint, reading short dumps, message types, and the performance tools.

Open contents

How well you use the debugger largely determines how productive ABAP development is. Where standard source is readable, it also lets you follow what SAP itself is doing.

Starting the debugger

MethodHow
BreakpointSet a stop position in the source
/h in the command fieldThe debugger starts at the next statement
BREAK-POINT statementWritten in the source; never transport it
BREAK usernameStops only for that user
Run from SE38Choose debug execution

Kinds of breakpoint

KindBehaviour
SessionActive for the logon session; the usual choice
ExternalAlso stops in RFC and web processing
StatementStops on a specific ABAP statement, such as MESSAGE
ExceptionStops when a given exception class is raised
Method or subroutineStops on entry to a processing block

A statement breakpoint on MESSAGE is the quickest way to find where an unexplained error message is being issued.

Watchpoints

A watchpoint halts when a variable changes, optionally only when it reaches a given value โ€” the way to catch one specific iteration inside a large loop.

Short dumps

What to read in ST22
SectionContent
Runtime errorThe category of failure
Error analysisWhat went wrong
Source code extractThe failing line and its surroundings
User and terminalWho ran it
Active callsThe call stack
Frequent runtime errors
ErrorCause
CX_SY_CONVERSION_NO_NUMBERArithmetic on text that is not numeric
CX_SY_ZERODIVIDEDivision by zero
CX_SY_ITAB_LINE_NOT_FOUNDA table expression found no row
CX_SY_REF_IS_INITIALCalling a method on an initial reference
TIME_OUTRuntime exceeded the dialog limit
DBIF_RSQL_SQL_ERRORThe database rejected the statement

Messages

Message types
TypeMeaningBehaviour
SSuccessStatus bar; processing continues
IInformationDialog box; continue on OK
WWarningReturn to the screen; can proceed
EErrorReturn to the screen; must be corrected
AAbendTerminates processing
XExitProduces a short dump

Performance tools

CodePurpose
ST05SQL trace โ€” statements and their durations
SAT (formerly SE30)ABAP runtime analysis
ST22Short dump list and detail
SM50 / SM66Process monitoring; find long runners
SLG1Application log
ST12Combined SQL and ABAP trace

๐Ÿ“– Unfamiliar term? Look it up in the SAP glossary.

Check your understanding

Test what you just read.

Quiz 1

Which transaction code is used to view ABAP short dumps (runtime errors)?

Quiz 2

Which debugger action advances to the next line without entering subroutines or methods?

Quiz 3

ABAP supports TRY~CATCH~ENDTRY exception handling.

Quiz 4

Which message type displays an error message in the MESSAGE statement?

Quiz 5

Entering /h in the command field activates the debugger.

Quiz 6

What prefix do ABAP exception class names start with?