Sunteți pe pagina 1din 24

Conditional Breakpoints

Efficient Debugging at Your Fingertips

Objectives

At the end of this unit, you will be able to:

SAP 2008 / Page 2

Understand the purpose of conditional breakpoints

Enable the usage of conditional breakpoints

Use conditional breakpoints for debugging

Agenda

1. The usage of conditional breakpoints


2. Perform setup for conditional breakpoints

Activate checkpoint group CRMUIF_CONDITIONAL_BREAKPOINTS


Enable external debugging

3. Use conditional breakpoints for CRM WebUI application debugging

SAP 2008 / Page 3

The Purpose of Conditional Breakpoints

Conditional breakpoints should help to overcome the following difficulties, that are
typical for debugging CRM UI framework based applications:

For a non-expert it is difficult to figure out where to set an ABAP breakpoint

Because of the deep call hierarchy even experts need many debugger clicks to
inspect the objects which cause a particular defect

Since the same coding is called frequently in a framework it is hard to interrupt


framework execution at the right time

The ABAP debugger does not support watch-points well

As a result they can be used to efficiently analyze the CRM application and to find
errors in customer enhancements.

SAP 2008 / Page 4

The Purpose of Conditional Breakpoints

Conditional breakpoints support efficient debugging at UI framework events like

Specified or non-specified UI Framework events (e.g. End-user presses any button)

A BOL Component is loaded

The design layer customizing for a field is determined

A UI Element is created via a CHTMLB-tag

At exceptions

many more

They allow to define conditions when the ABAP debugger is to be activated

For the name of a UI Framework event (e.g. SAVE)

For the name of a BOL Object (e.g. Sales Order)

For a part of an exception or message text (using wildcards)

for many more context attributes

SAP 2008 / Page 5

The Purpose of Conditional Breakpoints

Conditional breakpoints are predefined and delivered through standard


coding

Each conditional breakpoint is based on an assert statement

They are placed at error prone or central location


Example taken from
CL_CRM_BOL_ENTITY
method DELETE

SAP 2008 / Page 6

The Purpose of Conditional Breakpoints

Conditional breakpoints
can be directly activated
within the CRM UI
WebClient via hotkey
ALT-F2

SAP 2008 / Page 7

The Purpose of Conditional Breakpoints

The ABAP debugger


pops up automatically
when the conditional
breakpoint is reached.

SAP 2008 / Page 8

Agenda

1. The usage of conditional breakpoints


2. Perform setup for conditional breakpoints

Activate checkpoint group CRMUIF_CONDITIONAL_BREAKPOINTS


Enable external debugging

3. Use conditional breakpoints for CRM WebUI application debugging

SAP 2008 / Page 9

Setup for Conditional Breakpoints

Use transaction SAAB to


activate checkpoint group
CRMUIF_CONDITIONAL_
BREAKPOINTS for your
user.

Make sure your user has


authorizations for
debugging!

SAP 2008 / Page 10

Setup for Conditional Breakpoints

The following alternatives can be used to activate external debugging:


1.

Use transaction START_BSP to launch the CRM WebUI with the option External
Debugging On

2.

Activate debugging in transaction BSP_WD_CMPWB

3.

Activate external debugging in transaction SE80

SAP 2008 / Page 11

Setup for Conditional Breakpoints

Alternative 1: Use
transaction START_BSP
to launch the CRM WebUI
with the option External
Debugging On

SAP 2008 / Page 12

Setup for Conditional Breakpoints

Alternative 2: Activate
debugging in transaction
BSP_WD_CMPWB

SAP 2008 / Page 13

Setup for Conditional Breakpoints

Alternative 3: Navigate
into some workbench
coding (e.g. Page
default.htm in BSP
CRM_UI_START) in
transaction SE80. Choose
menu option Utilities
External Breakpoints
Activate

SAP 2008 / Page 14

Setup for Conditional Breakpoints

Troubleshooting: Watch
out for error messages in
the header of the
breakpoint definition
popup.

SAP 2008 / Page 15

Setup for Conditional Breakpoints

Troubleshooting: If the
debugger window does not
appear also you did the
setup and defined a
conditional breakpoint, try
to first delete all external
breakpoints that possibly
were defined in previous
sessions and re-try.
Choose menu path Utilities
External Breakpoints
Display

SAP 2008 / Page 16

Agenda

1. The usage of conditional breakpoints


2. Perform setup for conditional breakpoints

Activate checkpoint group CRMUIF_CONDITIONAL_BREAKPOINTS


Enable external debugging

3. Use conditional breakpoints for CRM WebUI application debugging

SAP 2008 / Page 17

Use Conditional Breakpoints for Debugging

You may want to use conditional breakpoints to analyze the coding of a standard application
feature to later use it as a template for a customer development.
As example: The feature of navigating from a search result table to the details of a result row.

SAP 2008 / Page 18

Use Conditional Breakpoints for Debugging

Navigate to a view that


contains the application
feature you want to
analyze and press ALT-F2.
Since you do not know the
technical event name that
triggers the application
feature you choose option
Additional break at any
Server Event.
With this option the
debugger pops up at any
UI event.

SAP 2008 / Page 19

Use Conditional Breakpoints for Debugging

After pressing a link in a


result row the debugger
window pops up and stops
at the conditional
breakpoint.
The ABAP comments
below the conditional
breakpoint explain how to
step into the event-specific
coding.
The variable
HTMLB_EVENT_EX>IF_HTMLB_DATA~EVEN
T_SERVER_NAME
contains the event name
SINGLESELECT.
SAP 2008 / Page 20

Use Conditional Breakpoints for Debugging

You followed the


instructions within the
ABAP comments below
the conditional breakpoint
and found the coding that
you want to use as
template for your customer
development.

SAP 2008 / Page 21

Use Conditional Breakpoints for Debugging

If you again want to debug


the same application
feature you can define the
breakpoint specifically for
the event name
SINGLESELECT found
out in the first debugging
session.
This prevents the
debugger to be launched
at non-relevant events.

SAP 2008 / Page 22

Lesson Summary

This unit covered

SAP 2008 / Page 23

The purpose of conditional breakpoints

The setup for using conditional breakpoints

The use of conditional breakpoints

Copyright 2008 SAP AG


All rights reserved
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed
without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, SAP Business ByDesign, ByDesign, PartnerEdge and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned and associated logos displayed
are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
The information in this document is proprietary to SAP. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document
contains only intended strategies, developments, and functionalities of the SAP product and is not intended to be binding upon SAP to any particular course of business, product strategy,
and/or development. SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or
other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of
merchantability, fitness for a particular purpose, or non-infringement.
SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation
shall not apply in cases of intent or gross negligence.
The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these
materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages

Weitergabe und Vervielfltigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrckliche schriftliche Genehmigung durch
SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen knnen ohne vorherige Ankndigung gendert werden.
Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte knnen Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind.
SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, SAP Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwhnte SAP-Produkte und Services sowie die
dazugehrigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Lndern weltweit. Alle anderen in diesem Dokument erwhnten Namen
von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zu
Informationszwecken. Produkte knnen lnderspezifische Unterschiede aufweisen.
Die in diesem Dokument enthaltenen Informationen sind Eigentum von SAP. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderen
Vereinbarung mit SAP. Dieses Dokument enthlt nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP-Produkts und ist fr SAP nicht bindend, einen bestimmten
Geschftsweg, eine Produktstrategie bzw. -entwicklung einzuschlagen. SAP bernimmt keine Verantwortung fr Fehler oder Auslassungen in diesen Materialien. SAP garantiert nicht die
Richtigkeit oder Vollstndigkeit der Informationen, Texte, Grafiken, Links oder anderer in diesen Materialien enthaltenen Elemente. Diese Publikation wird ohne jegliche Gewhr, weder
ausdrcklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschlielich, hinsichtlich der Gewhrleistung der Marktgngigkeit und der Eignung fr einen bestimmten Zweck
sowie fr die Gewhrleistung der Nichtverletzung geltenden Rechts.
SAP bernimmt keine Haftung fr Schden jeglicher Art, einschlielich und ohne Einschrnkung fr direkte, spezielle, indirekte oder Folgeschden im Zusammenhang mit der Verwendung
dieser Unterlagen. Diese Einschrnkung gilt nicht bei Vorsatz oder grober Fahrlssigkeit.
Die gesetzliche Haftung bei Personenschden oder die Produkthaftung bleibt unberhrt. Die Informationen, auf die Sie mglicherweise ber die in diesem Material enthaltenen Hotlinks
zugreifen, unterliegen nicht dem Einfluss von SAP, und SAP untersttzt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewhrleistungen oder Zusagen ber
Internetseiten Dritter ab.
Alle Rechte vorbehalten.

SAP 2008 / Page 24

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