SAP技術專家的ABAP偵錯程式培訓材料

i042416發表於2019-01-28

首先弄清楚ABAP Classic偵錯程式和新偵錯程式的區別:

SAP技術專家的ABAP偵錯程式培訓材料

Classic debugger:

(1) Static breakpoint

a. BREAK-POINT : non-user specific
b. BREAK user name user specific

(2) Dynamic breakpoint

New debugger:

(1)Static breakpoint
(2)Dynamic breakpoint
a. session breakpoint
b. external breakpoint

SAP技術專家的ABAP偵錯程式培訓材料

Session 斷點和External斷點的區別

(1) Session BP is only visible in all external sessions belonging to the same user session, while External BP is visible across all user sessions. Therefore, only External BP is valid for BSP / Webdynpro debugging.

(2) When a user logs off, Session BP will be deleted while external BP persists.

SAP技術專家的ABAP偵錯程式培訓材料

By setting this flag, if external session A is running, and in external session B ( A and B belongs to the same user session ) you set a session breakpoint in the program source code, the BP will be triggered immediately .

SAP技術專家的ABAP偵錯程式培訓材料

ABAP獨佔斷點(Exclusive Breakpoint)和非獨佔斷點的區別

下圖是非獨佔斷點:

SAP技術專家的ABAP偵錯程式培訓材料

下圖是獨佔斷點:

SAP技術專家的ABAP偵錯程式培訓材料

Exclusive mode means the application to be analyzed exclusively occupies a work process of the application server during debugging. If all exclusive debug work processes are occupied, the Debugger is switched to non-exclusive mode. (rdisp/wpdbug_max_no )

Limitation for non-exclusive mode:

Due to technical limitations in ABAP debugger implementation, there are following limitations when debugger is run under non-exclusive mode:
(1) No possible to debug statement between SELECT and ENDSELECT. In this case, program terminates with this error:

SAP技術專家的ABAP偵錯程式培訓材料

(2) No possible for conversion / field exit.
(3) No possible for debugging in production system, program terminates with exception DEBUGGING_NOT_POSSIBLE.

ABAP偵錯程式裡的一些指標該如何閱讀?

考慮下面這段最簡單的ABAP程式碼:

SAP技術專家的ABAP偵錯程式培訓材料

偵錯程式裡檢視A1這個型別為內表的變數:這裡的[2×1(8)]是什麼意思?

SAP技術專家的ABAP偵錯程式培訓材料

2: table row number
1: table column number
8: byte length of table row

The time for which the new Debugger is active is determined by the profile parameter rdisp/max_debug_lazy_time – which is set to 600 seconds in the standard version. After this time space has elapsed, the Debugger process is exited automatically and control is passed back to the application.

一些小技巧:how to debug background RFC?

SAP技術專家的ABAP偵錯程式培訓材料

解決方案:使用事務碼sbgrfcmon

SAP技術專家的ABAP偵錯程式培訓材料
SAP技術專家的ABAP偵錯程式培訓材料
SAP技術專家的ABAP偵錯程式培訓材料

小技巧2:如何除錯update task

SAP技術專家的ABAP偵錯程式培訓材料

小技巧3:如何使用ABAP觀察點 Watch point

SAP技術專家的ABAP偵錯程式培訓材料

練習:我們進入事務碼SE09時,會觀察到User欄位會自動被填充成當前登入使用者。如何透過觀察點快速找到是哪一行程式碼賦的值?

When we use SE09, how can we find the logic of the User? When and where is this field filled? What does content come from?
Debugging step by step will be very time-consuming.

小技巧4:使用ABAP檢查組 Check group

SAP技術專家的ABAP偵錯程式培訓材料

小技巧5:事務碼SRDEBUG

SAP技術專家的ABAP偵錯程式培訓材料
SAP技術專家的ABAP偵錯程式培訓材料

小技巧6:除錯指令碼

SAP技術專家的ABAP偵錯程式培訓材料

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":


SAP技術專家的ABAP偵錯程式培訓材料


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2565101/,如需轉載,請註明出處,否則將追究法律責任。

相關文章