Вы находитесь на странице: 1из 7

Tips & Tricks:

Debugging with
External Breakpoints

Harrison Holland, Partner at Holland Systems @ http://hollandsystems.com


07.20.2013
1

Introduction
Debugging ABAP can be a frustrating experience. On more than one experience Ive found myself kneedeep in code trying to understand what is happening when a failure occurs in a BAPI that I am calling.
Generally one of the first things that I like to analyze is the input and output data when debugging a
program. The ABAP debugger allows you to manipulate the input data for every field or data structure
in a program. Unfortunately its not always clear how every field is used, making it difficult to figure out
which elements of data correlate to each field in your ABAP program. If youve worked in SAP long
enough you know that the data model can seem quite obfuscated at times.

Fortunately for us, there is a nice feature in the ABAP debugger which allows us to pass data from an
external program into the debugging session. Lets say you have a third party application that calls a
standard BAPI/BADI: using external breakpoints you can pass data directly from your third party app into
the debugging session. This will help you quickly analyze your data to find out if there is a problem with
your input.

The purpose of this document is to demonstrate how to use the external breakpoints in the ABAP
debugger and give an example using SAP Identity Management.

ABAP Debugger Basics


There are several ways to open the ABAP debugger depending on what type of program you are
debugging. That being said, SE80 seems to be the most popular transaction code to edit ABAP programs
so that is the one I am using in my example.
Execute transaction code SE80

In this example I am debugging a class called CL_BADI_IDM_HR_COMMUNICATION which is used by SAP


IdM to update HCM infotype records.
Open the program to view the ABAP code

Setting Breakpoints
Using the menu bar along the top of the transaction you can now set breakpoints in the code at
various locations which can be used to stop the program flow for analysis periodically.

The session breakpoint icon is:


Session breakpoints are used for standard ABAP debugging that does not require an interface from a
third party application.
The external breakpoint icon is:
External breakpoints are used to pause the execution of the program when it is called via an external
interface. In our example this BADI is being called from SAP IdM and we want to pause the program and
analyze the data being sent from IdM.
To create a breakpoint, select the line of code at which you wish to pause the application, and press the
breakpoint button, you will see the breakpoint icon appear on each line you select.

Settings for External Breakpoints


This step is the key to making your external breakpoints function correctly. You must modify your ABAP
debugging settings to specify the username of the user that will be executing the program.
Select Utilities > Settings

Select the ABAP Editor tab, and then Debugging tab

You will find a field called User in the section Debugging External Requests. This is where you must
enter the user responsible for executing the program. An easy mistake to make is to enter your own
user ID, because after all you are the one who is debugging the program! However, its the user who
calls the program remotely that is important. In this case it may be the user assigned to the RFC
destination.

Make sure that the checkbox is selected at the bottom of the screen which says Session breakpoint
active immed.
5

Program Execution / Debugging


When the debugging session becomes activated a new ECC screen will appear and you will be taken to
the ABAP Debugger. The program flow will have already stopped at the first breakpoint that was set.
The top of the screen contains the navigation bar with several important buttons:

Most notably is the first and fourth buttons

The first button allows you to step through each line of code one by one. The fourth button is the
Continue button which will take you to the next breakpoint.
At the bottom right hand side of the screen there is a table that will display the variables and the data
that is being stored in those variables:

You can display the data in a variable by double-clicking on the element in the code (left hand side of the
screen):

Double-clicking on the variable lv_countryiso_ee will display the values


6

About the Author


Harrison has over 10 years of experience working with SAP,
focusing on master data strategies and systems integration.
He is one of the founders of Holland Systems, an Atlantabased boutique consulting firm that is revolutionizing the
SAP consulting space.
Harrison enjoys listening to loud music, playing video
games, watching boxing, and motorsports. He competes in
a local go-kart league despite getting schooled by
teenagers.

Вам также может понравиться