如何快速定位SAP CRM订单应用(Order Application)错误消息抛出的准确位置
In my blog Six kinds of debugging tips Fabian Geyer raised a very good point about the trouble during ERP Application trouble shooting.
Let me just quote his good statement:
“Several ERP applications (esp. Financials) often use a “message collector” technique especially when handling “multiple objects”, where after the application ist “detecting” an error it will be “stored” to an “error collection” and after all checks have been done the list of maybe many errors?is shown in a popup or list.
In these cases, when the message is “shown” is far to late to analyze, because the application data/situation which is causing the error is analyzed somewhere else (far earlier in the runtime). In these cases I often use breakpoints in FM “MESSAGE_STORE”.
Similar handling is needed in case the BC Application Log-technique is used (SLG0, SLG1 etc.) a breakpoint in FM BAL_LOG_MSG_ADD can help. “
Actually in CRM application the error message handling logic is the same. Let me just use the example of Service Contract processing as example:
How to find the code where the message CRM_ORDERADM_I with number 505 is raised?
Approach1: Use the source code scan
For more details about how to use source code scan, please refer to my previous blog.
When I am using this approach to write the blog, it just took me several minutes to find the exact code position.
First we use the source code scan tool ( search keyword = 505) to find the constant ITEM_TYPE_NOT_FOUND for message number 505. Since I know the program CRM_STATUS_CON has defined constants for all status, then I execute the search report with the parameter below:
And here is the result:
Then use the source code scan once again. The question is how to specify the input parameter?
(1) We know that service contract is implemented via one order framework. Just display function module CRM_ORDER_* for example CRM_ORDER_READ, and get its package name CRM_ORDER:
(2) execute the search report with the following input:
Nothing found. Then I change CRM_ORDER to CRM_ORDER*. This time we get seven candidates, then just set a breakpoint at each and repeat your scenario.
The third one in result above is proven to be the location we are just looking into:
Approach2: Use function module BAL_LOG_MSG_ADD
This tip is suggested by Fabian Geyer and is also very good. Just set a breakpoint on function module BAL_LOG_MSG_ADD and repeat the scenario in service contract. The breakpoint is triggered( you can observe the FM is now displayed in the top-most of callstack ) and the code position we found this way is just exactly the same as Approach 1.
In this case the Approach 2 is even more efficient than Approach 1 to quickly locate the code we look for. Thank Fabian for sharing us such useful tip.
Setting breakpoint in function module BALW_BAPIRETURN_GET2 would be another good attempt.
Why neither approach works for me? Why the breakpoint is not triggered in my application?
Still use service contract for example, the business transaction like Sales Order, Service Order and Service Contract are implemented via so-called One Order Framework. And as clearly described by Fabian which I quote in the beginning of this part, the error detection logic of One Order Framework, in this example is the logic in form DETERMINE_ITEM_TYPE, is ONLY done for the first time the item is inserted. Once an error is found, the respective function module in the function group CRM_MESSAGES will be called to persist the error message. Later on when the erroneous service contract is opened once again, there are no item type check any more, instead the error message is fetched via read function module in the function group and displayed in the UI.
When I delete one item product in the service contract, the obsolete error message for that item would also be deleted by the corresponding FM CRM_MESSAGES_DELETE.
So when I am trouble shooting the error message raised in Business Transaction application, I will either delete the old erroneous item then recreate it, or create a new one from scratch. Of course if we need to do debugging in production system, both could be inappropriate.
In this case if you can ensure that the error message raised in customer production system could also be reproduced in your dev system, then you can still use the tips in this blog to find the position in an efficient way.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- [SAA + SAP] 13. S3
- 87. 如何让 SAP UI5 Mock 服务器支持自定义 url 参数
- 使用代码给 SAP UI5 XML 视图添加自定义 CSS
- 授人以渔 - 如何自行查询任意 SAP UI5 控件属性的文档和技术实现细节试读版
- 点击SAP Fiori Launchpad某个tile后遇到的错误消息如何解决
- 使用 SAP ABAP Memory Inspector 对应用程序消耗内存进行检测时常犯的错误试读版
- 使用 Excel cdata addin 连接 SAP ABAP 系统时遇到错误消息 Unable to connect to SAP system
- 使用 SAP WebIDE 将 SAP UI5 应用部署到 ABAP 系统时遇到的关于传输请求的错误
- SAP OData实现错误消息:OPPORTUNITIES_GET_ENTITY not implemented in data provider class
- SAP WebClient UI和business switch相关的逻辑介绍
- 引起SAP WebClient UI页面出现超时(time out)错误的另一个原因
- 如何分析SAP ABAP的SYSTEM_NO_ROLL运行时错误
- SAP 电商云 Spartacus UI 同 SAP Customer Data Cloud 集成运行时的 api
- 如何使用schematics快速创建全新的SAP Spartacus Storefront并启用SSR
- SAP Spartacus storefront 模块的实现位置
- SAP Spartacus category navigation按钮之间的间隔问题
- Angular HTTPClient API 在 SAP 电商云中的使用
- SAP Cloud for Customer前台发送到后台的HTTP请求,遇到错误该怎么分析
- 关于 SAP Commerce Cloud 启动时报 Address already in use - bind 的错误消息
- SAP Word template出了错误后的调试办法
- 如何处理SAP HANA Web-Based Development Workbench的403 Forbidden错误
- SAP Analytics Cloud Model的delta upload(增量导入)功能
- SAP UI5 DynamicPage 控件介绍
- 如何处理SAP Fiori Launchpad错误消息:Could not start the app due to a configuration problem
- SAP Fiori应用发生超时错误的一个可能原因
- 如何分析SAP Fiori运行时报出的HTTP Request Failed错误消息
- SAP OData 服务在 gateway 层出错,应该如何处理?通过一个错误消息 Query XXX is invalid or contains errors 来举例说明
- 如何在 SAP 电商云 Spartacus 代码里获取 Routes 路由信息