The ABAP Debugger is used tool to execute and analyze programs line by line. Using it we can check the flow logic of a program and display runtime values of the variables. Currently, SAP offers two types of Debuggers:

  • The Classic ABAP Debugger
  • The New ABAP Debugger

The Classic ABAP Debugger, with its old user interface and its limitations to debug certain types of ABAP program is now not in use by many new and old ABAP developers.

The New ABAP Debugger, with its state of the art and flexible user interface, can be used to debug all types of ABAP programs. It provides many new features which improve our efficiency of debugging, both in ABAP support and development.

In this article, we will learn how to use these new features and discover some tips and tricks to efficiently use ABAP debugger. 

Switching between the 'Classic Debugger' and 'New Debugger'

You can switch between both the debugger and make any one your default debugger. To do this, go to ABAP Editor (SE38)→ Utilities → Settings.

 
 

Now in the user-specific settings pop up box click on ABAP Editor tab and then click on Debugging.

 
 

Here you can select the New Debugger radio button to make it your default debugger.

 
 

External (User) Debugging

External debugging is used when we want to analyze our program which is called by an external user through HTTP such as Web Dynpro ABAP, Web Dynpro JAVA, and BSP etc. To activate external debugging we have to set external breakpoints, which can be set just like the session breakpoints by keeping the cursor on the desired code line and clicking on the 'External Breakpoint' icon.

 
 

We can also set the external user for whom the breakpoint is to be activated by going to ABAP Editor (SE38)→ Utilities → Settings, and in the 'user-specific settings' pop up box click on ABAP Editor Tab and then click on Debugging.

Here you can specify the username.

 
 

 
 

Watchpoints

Watchpoints can be used to break the execution of a program when the values in a variable changes.

This help us to go to the exact position where the variable changes. You can also specify conditions in Watchpoint and the execution of the program will break as soon as the condition is fulfilled.

To create a Watchpoint, click to the Watchpoint button in the New ABAP Debugger.

Now, in the Create Watchpoint pop up enter the variable name for which you want to create the Watchpoint.

 
 

Debugger Variants

With the help of Debugger Variant you can save the current debugger settings into the database or to a local file. These settings include breakpoints, UI customizations and other special options for debugging tools.

Next time, when you will be debugging the same application you will not have to set breakpoints again or to do all the settings again. Also, when you are working in a large team then you can also pass the debugging variants to other users.

To save the 'Debugging Variant' go to Debugger→ Debugger Session→ Save

 
 

 You can save the current debugger session either to a file or in the database.

 
 

In the Debugger Variant you can save the following components :

  1. Layout
  2. Breakpoints
  3. Settings
  4. Options

 
 

To load the saved Debugger variants go to Debugger → Debugger Session → Load

 
 

Debugging a modal window

Generally, we can activate debugging by typing /h in the command line, but what if the command line is not there?

 
 

Often you will come across modal windows and other pop-up windows command line is not present and we cannot activate debugging directly. In such cases, you can either create a SAPGUI shortcut of type 'System Command' and command '/h' or create a text file with below texts.

[FUNCTION]

Command=/H

Title=Debugger

Type=SystemCommand

To debug a modal window drag and drop the above created file over it.

 
 

Debugging Tricks

Many a times, due to an incorrect entry in a database table or a table without maintenance view we are not able to create, edit or delete a database record. In these cases we can use this debugging trick.

To do this, go to transaction code SE16.

 
 

Enter the name of your database table. Select the line which you want to process, and press the display button. Enter /h in the command line and hit enter button two times.

 
 

Now, the debugger window will open and you can see the source code. Click on the variable CODE, it will have 'SHOW' as its value.

 
 

Here you can edit this variable and set the new value based on the operation you want to perform.

By setting the variable 'CODE' with value as 'EDIT' you can edit records,

'INSR', Insert new records

'DELE', Delete records

And, 'ANVO' is for editing the record with primary keys.

 
 

After setting the variable with the required operation, hit F8. Now, you are in EDIT mode. Press save button to save the record.

 
 

The Magic of SHIFT + F12

You can use this key combination to bypass a specific line of code such as a normal sy-subrc check or an authorization check. To jump or bypass any line/lines of code all  you have to fo is just put your cursor on the desired line and then press the SHIFT + F12 key.

Some limitations of New ABAP debugger Screen Debugging

When you try to set breakpoints in screen/dialog programs, you get the message stating that debugging is not yet supported.

 
 

To get by this and debug your screen/dialog programs just switch back to the classical debugger.

 
 

ABAP Memory ID

In the new debugger it is not possible to view the used ABAP memory ID's and their content. But, in the classical debugger you can view the ABAP memory IDs by going to Go to → System Areas → ABAP Memory

 
 

来自 <http://blog.csdn.net/hackai886/article/details/8032335>

Debug Intro的更多相关文章

  1. qqmini

    QQ玩一玩最新调试方法 https://blog.csdn.net/zyw_java/article/details/83686645 LayaBox 接入QQ玩一玩 轻游戏流程 https://bl ...

  2. jmeter sampler maven项目排错记

    eclipse 创建的maven项目,引入jar包之后出现红色叹号,一直找不到原因,连main方法都无法运行,提示找不到类: 错误: 找不到或无法加载主类 soapsampler.SoapSample ...

  3. Debug with jdb

    原文地址: http://www.javaworld.com/article/2077445/testing-debugging/debug-with-jdb.html Q: How do you u ...

  4. 在mac平台运行debug.exe

    最近准备学习操作系统,想先复习一下汇编语言.因为用的是mac,而看的汇编教材(<汇编语言>王爽)使用到DOS下的debug,在网上搜了一圈发现,mac 也可以模拟运行debug. 先到网上 ...

  5. 记一次debug记录:Uncaught SyntaxError: Unexpected token ILLEGAL

    在使用FIS3搭建项目的时候,遇到了一些问题,这里记录下. 这里是发布搭建代码: // 代码发布时 fis.media('qa') .match('*.{js,css,png}', { useHash ...

  6. .NET Core的日志[3]:将日志写入Debug窗口

    定义在NuGet包"Microsoft.Extensions.Logging.Debug"中的DebugLogger会直接调用Debug的WriteLine方法来写入分发给它的日志 ...

  7. 设置tomcat远程debug

    查看端口占用情况命令: netstat -tunlp |grep 8000 tomcat 启动远程debug: startup.sh 中的最后一行 exec "$PRGDIR"/& ...

  8. Android NDK debug 方法

    最近又频繁遇到 NDK 的错误,记录一下debug调试的一些经验,以备后续查看 一般来说,在Android Studio中的Monitor中将过滤器的 LOG TAG 设置为 "DEBUG& ...

  9. 玩转Windows服务系列——Debug、Release版本的注册和卸载,及其原理

    Windows服务Debug版本 注册 Services.exe -regserver 卸载 Services.exe -unregserver Windows服务Release版本 注册 Servi ...

随机推荐

  1. Android设置窗口、控件透明度

    设置透明效果的方法如下: 1.在布局文中设置透明效果 android:background="@android:color/transparent" (通过android自带颜色设 ...

  2. JavaEE&Docker 容器示例

    准备:jboss.jdk.一个javaee的war包.Dockerfile 注:jboss和jdk可以不用提前准备好,在命令中wget也可以,因为我恰好有,就直接复制了 Dockerfile内容: # ...

  3. 3.1html学习之列表

    一.含义: ul:unorder list ol:order list li:list item dl:definition list dt:definition term dd:definition ...

  4. app 性能优化的那些事(二)

    来源:树下的老男孩 链接:http://www.jianshu.com/p/2a01e5e2141f 这次我们来说说iOS app中滑动的那些事.iOS为了提高滑动的流畅感,特意在滑动的时候将runl ...

  5. CSS 之 内层div填充margin,外层div的背景色不会覆盖该margin

    外层元素(如div)中只有一个非空子元素,此时margin是被折叠了.两者之间取最大的margin值,表现在外层父元素上,而不是内层子元素. 注意: (1)只有垂直方向上才会出现此现象,水平方向不会出 ...

  6. 从零开始学JAVA(04)-连接数据库MSSQL(JDBC准备篇)

    在JAVA中可以使用JDBC连接数据库,不管是哪种数据库,首先必须下载驱动,包括Windows的MSSQL. 1.下载MSSQL的JDBC驱动,可以通过百度“Microsoft JDBC Driver ...

  7. python获取每颗cpu使用率

    以下是关于python来获取服务器每颗CPU使用率的使用脚本. #!/usr/bin/env python # -*- coding: utf-8 -*- import re,time def _re ...

  8. 使用JSON进行数据传输的总结

    一.选择的意义 在异步应用程序中发送和接收信息时,可以选择以纯文本和 XML 作为数据格式.为了更好的使用ajax, 我们将学习一种有用的数据格式 JavaScript Object Notation ...

  9. Android 自定义Dialog工具类

    由于项目的需要,系统的弹出框已经不能满足我们的需求,我们需要各式各样的弹出框,这时就需要我们去自定义弹出框了. 新建布局文件 dialog_layout.xml,将下面内容复制进去 <?xml ...

  10. P2342 叠积木

    P2342 叠积木 17通过 66提交 题目提供者wwqk4444 标签树状数组线段树USACO 难度普及+/提高 提交该题 讨论 题解 记录 最新讨论 暂时没有讨论 题目背景 Cube Stacki ...