SAP CRM WebClient UI,如何快速定位到丟擲錯誤訊息的那一行程式碼
本文是Jerry的原創,最早發表於SAP官方社群,英文版連結如下:
As a developer in my daily life I always need to quickly locate the source code where raises a given message in webclient ui.
If you would like to know how to quickly find the source code which raises message in SAP GUI environment, please refer to this blog of mine instead.
Here below are four approaches using which almost all messages I meet with so far could be located:
- If some invalid data is input which blocks the account save, the generic message saying “data contains error” without dedicated erroneous field is not helpful. Suppose I would like to find the exact code which raises error message. You can observe that if I put the mouse onto the error message, there would be a tooltip poped up with message technical information like message id and message number. By default this behavior is not activated for your user. You can manually activate it via:
go to transaction code SU3 and maintain user parameter BSPWD_USER_LEVEL = 6
6 means “Experienced user”. You can find the description of all possible value in domain BSPWD_MSGLEVEL.
Now we know the message id is CRM_BUPA_BOL and number is 036. Go to transaction code SE91 and search code via where use list:
we get 2 hits: double click on one of them. Why there is if 1 = 2 whose condition will never be met?
actually the red code below is just what we look for. The above code in line 86 is just simply written in order to enable itself to be found by where use list,
since where used list in abap workbench would only find the static message usage like keyword MESSAGE + <message type like e,i,w><message number>
(<message id>). The red code does not really raise message via keyword MESSAGE but just put the given message into an internal table via global message service and thus would not be found by where use list.
- In IC agent inbox, if an unsupported search attribute is specified, the search could not be performed and the corresponding message is raised in ui.
unfortunately now if I follow approach 1, no hit in where use list.
so I try to use report RS_ABAP_SOURCE_SCAN, use 559 as search key, and maintain CRM_IC_APPL_INBOX as package. The report will scan 559 within all ABAP source codes which are stored in that package.
So how can I get the package name CRM_IC_APPL_INBOX? Just click F2 on UI, I can know the view name ICCMP_INBOX/InboxSearch.
in its event handler for event SEARCH, I can know that the search implementation is actually provided by class CL_CRM_AUI_QUERY_SERVICE.
so now I can ensure that the code which raises the information message is definitely inside that package.
after a while the report runs over and I can simply double click the result to jump into the source code.
- When it comes to product area, it is pretty easy to find the source code of given message. Almost all underlying messages in product application is raised by utility function module COM_PRODUCT_ADD_MESSAGE. In example below I input an invalid item category group WWW and would like to find which code does validation check and raise error message. All I have to do is just to set a breakpoint in that function module, and re-save in UI:
breakpoint is hit as I expect after I click save button again:
the sy-subrc indicates that there is some exception raised, and just above the FM COM_PRODUCT_ADD_MESSAGE, we can find the FM COM_PRODUCT_CHECK_FIELD_ENTRY complains that the input WWW is not valid.
- This is the most powerful debugging method. Suppose I need to find which line of code raises this message below:
Use F2 button I know that the current search page is built on BP_HEAD_SEARCH/MainSearch:
So I set a break point on search event handler:
The breakpoint is hit when I click search again. However I will not debug it line by line. Click tab “Break./Watchpoints”, and create a dynamic breakpoint for ABAP command MESSAGE. As a result the breakpoint will be triggered wherever the keyword MESSAGE is written in ABAP code.
I just click F8, and debugger automatically stops in the line below, which is just what we are looking for.
Summary
all the four methods above makes my trouble shooting life easier. If you have any other approaches to achieve the same, welcome to share with us
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2702902/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何自行分析SAP WebClient UI開發環境裡丟擲的錯誤訊息根源WebclientUI開發環境
- 如何根據 SAP UI5 框架程式碼丟擲的錯誤訊息,反查出是哪一行程式碼引起的錯誤訊息試讀版UI框架行程
- XCode除錯時丟擲異常,定位到某一行程式碼XCode除錯行程
- 【APIM】Azure APIM丟擲 java.lang.RuntimeException 錯誤定位APIJavaException
- SAP錯誤訊息除錯之七種武器:讓所有的錯誤訊息都能被定位除錯
- SAP CRM WebClient UI表格編輯模式的除錯明細WebclientUI模式除錯
- SAP CRM WebClient UI和Hybris的controller是如何被呼叫的WebclientUIController
- Promise基礎(消化錯誤和丟擲錯誤)Promise
- 如何修復 SAP UI5 aggregation with cardinality 0..1 相關的錯誤訊息UI
- SAP CRM WebClient UI和Fiori UI混搭並存WebclientUI
- SAP CRM WebClient UI和Hybris backoffice UI開發的相同點WebclientUI
- SAP CRM WebClient UI異常的持久化機制WebclientUI持久化
- 將SAP CRM WebClient UI的表格匯出成PDFWebclientUI
- 使用SAP CRM中介軟體從ERP下載Customer的錯誤訊息
- 部署 SAP UI5 應用到 SAP BTP 時遇到的 fiori not found 錯誤訊息UI
- SAP CRM WebClient UI的Delta處理機制介紹WebclientUI
- SAP CRM WebClient UI html 格式的 Text 顯示邏輯WebclientUIHTML
- SAP CRM WebClient UI 支援的一些 url 引數WebclientUI
- 部署 SAP UI5 應用到 SAP BTP 時遇到的 error retrieving MTA 錯誤訊息UIError
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 使用Selenium自動化測試SAP CRM WebClient UIWebclientUI
- CRM中介軟體裡parent not ok的錯誤訊息如何處理
- SAP CRM WebClient UI的on_new_focus應該怎麼理解WebclientUI
- SAP CRM WebClient UI和Hybris Commerce的懶載入機制WebclientUI
- SAP CRM WebClient UI Text Type 顯示的過濾邏輯WebclientUI
- 如何把SAP CRM WebClient UI上某個欄位高亮加粗顯示WebclientUI
- CRM WebClient UI裡的檔案是如何上傳到Netweaver後臺的WebclientUI
- 如何將Twitter訊息匯入到SAP CRM和Cloud for Customer去Cloud
- 在SAP CRM WebClient UI裡開啟ABAP Webdynpro頁面WebclientUI
- SAP CRM WebClient UI和ABAP Webdynpro頁面的互相跳轉WebclientUI
- 如何在SAP WebClient UI裡使用jChartFXWebclientUI
- 關於 SAP UI5 getSAPLogonLanguage is not a function 的錯誤訊息以及 API 版本的討論UIGoFunctionAPI
- SAP CRM WebClient UI cross component跳轉的一個具體例子WebclientUIROS
- SAP CRM WebClient UI Text 可編輯與否的控制邏輯WebclientUI
- SAP Spartacus RouterModule.forRoot() called twice 的錯誤訊息
- 如何在CRM WebClient UI裡使用HANA Live ReportWebclientUI
- 引起SAP WebClient UI頁面出現超時(time out)錯誤的另一個原因WebclientUI
- Hybris service layer和SAP CRM WebClient UI架構的橫向比較WebclientUI架構