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的原创文章,请关注公众号"汪子熙":

如何快速定位SAP CRM订单应用(Order Application)错误消息抛出的准确位置相关推荐

  1. 如何调试SAP CRM产品主数据应用后台ABAP端抛出的错误消息

    Created by Wang, Jerry, last modified on Dec 19, 2014 核心函数:COM_PRODUCT_ADD_MESSAGE 要获取更多Jerry的原创文章,请 ...

  2. 如何使用代码创建和读取 SAP CRM 订单的 Text 数据

    SAP CRM Fiori 应用里,可以为 Opportunity 等订单,维护 note. note creation 后台实现实际上很简单. GM6上创建一个note: HTTP post的req ...

  3. SAP CRM 订单抬头文本的可编辑性讨论

    Sent: Thursday, December 11, 2014 1:04 PM Subject: RE: [wave8 backend research] why header level not ...

  4. 快速找到SAP CRM WebClient UI thtmlbUtil的定义位置

    Created by Jerry Wang, last modified on Oct 10, 2014 Go to start of metadata 例如想知道view BSPWD_BASICS/ ...

  5. 关于 SAP CRM 订单抬头级别的 Text 无法编辑的问题分析

    QDD/504: sales order type :TA 每次我们新建TA类型的sales order,然后输入sold to party id 3272, 回车之后我们发现Sales order的 ...

  6. 如何阻止SAP CRM订单创建好之后,自动被置为传输状态这一行为

    AG9 Service order创建好之后,要自动通过middleware传其他系统去,这个behavior我们现在记录下来了么?知道怎么disable不? Transaction的status p ...

  7. 如何使用代码的方式删除 SAP CRM 订单 Text 数据

    如果call CRM_ORDER_MAINTAIN的时候传一个change mode = U – update,但是text content = ''进去能不能成功执行? 目前webclient ui ...

  8. 使用report PRC_SHOW_PRICING_DOCUMENT查看SAP CRM订单的pricing数据

    例子: ID为5022416的pricing数据 在后台执行report PRC_SHOW_PRICING_DOCUMENT,输入report ID: 双击: Pricing明细: 要获取更多Jerr ...

  9. SAP CRM订单状态下拉菜单字段里的值是怎么配出来的

    From: Wang, Jerry Sent: Friday, January 20, 2017 12:17 PM Subject: 为什么transaction type没有维护status pro ...

最新文章

  1. #51CTO学院四周年#让学习成为习惯
  2. ajax工具、框架和库
  3. 【网络】HTTP基础总结
  4. 13个JavaScript单行式代码
  5. clone是深拷贝还是浅拷贝_go-clone:深拷贝 Go 数据结构
  6. Luogu3092 [USACO13NOV]没有找零No Change (状压DP)
  7. 电脑上怎么做pdf文件_PDF压缩文件怎么压缩最小?请收好这些PDF压缩方法
  8. android通知图标变白色,android 7.0通知图标出现白色方块
  9. 期权数据 获取_我如何免费获得期权数据
  10. Thread多线程一起执行睡眠,同时分开执行,实例
  11. 10.related product , up-sell product and cross-sells
  12. ucos信号量集源码分析
  13. paip.点击每个网页链接都提示下载的解决。
  14. python3 ValueError: The shape of the input to Flatten is not fully defined (got (0, 6, 80)
  15. Hadoop系列教程:服务器基础环境
  16. 操作系统课程设计(作业调度、内存管理、进程调度、进程阻塞等)
  17. 服务器虚拟化和桌面虚拟化
  18. 鼠标双击成了查看属性是怎么回事?怎样解决?
  19. C语言之位操作和整形的补位
  20. 《Dreamweaver CS6 完全自学教程》笔记 第十四章:使用 CSS 设计网页

热门文章

  1. 【插件开发】—— 13 GEF双击模型事件
  2. PageOffice实现最简单的Java导出Word中的数据
  3. Linux输入法的几点补充
  4. 使用Hexo搭建博客,备份至GitHub过程(基于网上资料的实践操作)
  5. C++读取与保持图片
  6. 第四篇 Python循环
  7. [转]Android动态加载jar/dex
  8. sql server 2005日志文件过大问题解决后分析--针对发布订阅产生的日志问题
  9. PyTorch基础(part5)--交叉熵
  10. 网络编程(part6)--OSI七层模型及四层模型(TCP/IP)