Sunteți pe pagina 1din 23

ABAP Debugging Techniques

Table of Contents
Need for Debugging .

Debugging requirement.
Initial Set Up Debugging Types. Debugging Screen. Single Dimensional structure

.....
..... . ..... ..

Two Dimensional structure.


System Variables. Break Point. Watch Point. Termination of Batch Job

.
. . . .

Background Job Overview


Dump Analysis Error List Runtime Analysis

.
. . .

Need for Debugging

Need for Debugging


Problem Type Starting point for analyzing a crashed program/ background job Tool System Log (SM21)

Runtime Error
Unexpected Program behavior Finding specific statement, function, method

ABAP Dump Analysis (ST22)


ABAP Runtime Analysis (SE30) ABAP Runtime Analysis (SE30)

Performance problem
Screen Processing Detailed error analysis source code level

ABAP Runtime Analysis (SE30)


SQL Trace (ST05) Screen Trace (ST20) ABAP Debugger

Debugging Requirement

Debugging requirement

Report. Function Module

User Exit
Screens Module Pool Program.

Standards Programs.
Background Jobs.

Debugging - Report

USAGE

Change field values at Runtime, of variable or ITab field for manipulating the logic flow. Skip record counts within a loop and arrive at particular iteration of concern.

To directly pinpoint to a field value of Internal Table.


Check for proper Data retrieval and Logic flow.

Initial Set Up
Identify relevant variable to locate appropriate point in code to start debugging.

Menu Bar Utilities Breakpoint Set.


Enter /h in command line. (Optional wherein need to debug incorrect value field on first screen) Using hard code in ABAP program BREAK-POINT Execute.

Control switches to Debugging Mode.

Debugging Types

Single Step (F5): Control passes through each executable statement. Execute (F6): Control overruns through each Subroutine, without passing through code within. Control skips current subroutine. Control runs to next debugging point or reaches the end result of the program.

Return (F7): Run (F8):

Debugging Screen

Single Dimensional structure Variable/ Field: Structure: Contains data. Consists Multiple fields.

Work Area:

Current line of ITab, contains multiple fields.

Process
FIELD button -> enter name in Col Field names data displayed in Field Contents.

Field Contents can be modified using Change button.

Two Dimensional structure

Internal Table:

Contents of database table retrieved by ABAP code (selected fields).

Process

Tables button enter name in Internal table section OR double click on ITab name Table data displayed below.
Change field contents: double click on any ITab field leads to Single Field Contents screen use Change button for Runtime changes

System Variables SY-SUBRC: Successful execution of previous statement System variable providing fruitful information, about confirmation of retrieval statement. sy-subrc = 0 successful retrieval of data sy-subrc <> 0 unsuccessful retrieval of data SY-TABIX: Current line number of internal table.

SY-DBCNT: Total No of lines processed.

Break Point

Break Point is set within a loop with 10,000 iterations. Interested to know about processing for 900th iteration. Executing F8 until then is time consuming, instead use Break Point feature. Features: Skip record counts within a loop. Specify the record number for processing to be checked.

Watch Point To directly pinpoint a field of Internal Table having particular value.

Can be placed for any field of Internal table.


Features:

Comparison Operator.
Comparison Field Value. Logical Operator.

Local/ Global data.

Debugging Background Job

Termination of Batch Job Transaction for Batch Job: SM37

Execute for given User.


Identify particular Job from the displayed list of Jobs.

Check for Job Log.


For the erroneous Message Text note the Message Number and Class. Identify the actual message text using SE91.

Background Job Overview

Debugging Dump Analysis Tool

Dump Analysis

Transaction : ST22
Execute for given User/ Program/ Date.

Provides list of errors for given selection.


Selection of particular error gives the Runtime Error Description.

List of Errors for given User

Runtime Error

S-ar putea să vă placă și