SAP CRM WebClient UI,如何快速定位到抛出错误消息的那一行代码
本文是Jerry的原創,最早發表于SAP官方社區,英文版鏈接如下:
https://blogs.sap.com/2013/09/25/how-to-quicly-locate-the-source-code-where-raises-a-given-message-in-webclient-ui/
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:
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>
(). 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.
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.
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.
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的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的SAP CRM WebClient UI,如何快速定位到抛出错误消息的那一行代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 十分钟免费拥有永久网站(汉典十字的基本解
- 下一篇: 因为我们今生有缘原唱 送给喜欢的你