`
JerryWang_SAP
  • 浏览: 1031304 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

SAP CRM WebClient UI,如何快速定位到抛出错误消息的那一行代码

阅读更多

本文是Jerry的原创,最早发表于SAP官方社区,英文版链接如下:

blogs.sap.com/2013/09/2

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:

  1. 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 + (). 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.

 

 

  1. 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.

 

 

  1. 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.

 

 

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

0
0
分享到:
评论

相关推荐

    CRM7.0 WebClient UI config

    在SAP CRM 7.0版本中,WebClient UI配置是一项关键任务,它涉及到了用户界面的定制和优化,以提升用户体验和业务效率。WebClient UI是SAP CRM的一个核心组件,提供了一个基于Web的交互界面,使得用户能够访问和操作...

    SAP_CRM中文自学笔记

    CRM系统能够处理从客户数据的收集、管理到客户交互过程中的订单处理、服务请求等业务流程,是SAP商务套件的一部分,能够与SAP ERP(企业资源计划)系统进行紧密集成。 SAP CRM的基础知识通常包括对于其核心组件的...

    Creating a Dropdown in SAP CRM WebUI.docx

    在SAP CRM WebUI中创建下拉列表是一个关键任务,特别是在设计用户界面以提供更高效、用户友好的交互时。本教程将引导你通过一系列步骤来实现这一目标,特别是针对SEX(性别)属性创建一个下拉框。 首先,你需要获取...

    SAPCRM基础培训教材.doc

    从最初的GUI界面,到PCUI,再到IC WebClient,最终发展到目前最新的WebClient UI,这一过程中,用户界面不断优化,以适应不同设备和用户的使用需求。在CRM 7.0版本中,引入了BSP/BOL技术和HTTP协议,允许用户通过...

    SAP CRM WebClient UI cross component跳转的一个具体例子

    Subject: 为什么design time时候看到的是ICQR,点了service之后看到02QR的代码被call到 这是cross component navigation在起作用。 Result list是model在ICQR里面,如果点service,会navigate到service detail page...

    UI Guidelines for CRM WebClient User Interface

    UI Guidelines for CRM WebClient User Interface

    SAPCRM基础培训.doc

    在SAP CRM基础培训中,WebClient UI(Web客户端用户界面)是一个重要的学习焦点,它是用户与系统交互的主要界面。下面我们将深入探讨WebClient UI的相关知识点。 WebClient UI的发展历程是从GUI(图形用户界面)...

    SAP CRM WebClient UI ON_NEW_FOCUS的用途

    Sent: Thursday, May 9, 2013 6:30 PM Subject: ON_NEW_FOCUS的用途 ROOT ———————————— Product ID PRODshortText ———————————— Product Description Genil Model hierarchy

    WebClient 上传文件到 iis

    首先,在C#代码中创建一个WebClient对象。例如: ```csharp using System.Net; ... WebClient client = new WebClient(); ``` 2. **设置请求头**: 在上传文件之前,可能需要设置一些HTTP请求头,如Content-...

    WebClientDemo_webclient_

    【WebClientDemo_webclient_】项目是一个C#编程示例,展示了如何使用`WebClient`类来实现文件的下载功能。在.NET Framework中,`WebClient`是System.Net命名空间下的一个类,它提供了一种简便的方法来上传和下载数据...

    sap 简介及关键提示

    产品建议不仅能在标准订单等销售事务中应用,还能在CRM WebClient UI(交互中心)和Web渠道中实时呈现,帮助销售人员在与客户的互动中快速响应并提供个性化建议。 通过灵活地配置产品联想规则,企业可以设定复杂的...

    WebClient下载文件展示进度条

    请注意,实际应用中可能需要处理错误和异常,以及考虑线程同步问题,确保UI线程安全地更新进度条。此外,如果要实现更复杂的功能,比如暂停和恢复下载,可能需要使用更高级的类如System.Net.Http.HttpClient,配合...

    利用WebClient和WebRequest类获得网页源代码

    本篇文章将深入探讨如何使用`WebClient`和`WebRequest`类来实现这一目标。 `WebClient`是.NET Framework提供的一种简单易用的类,用于执行基本的HTTP操作,如下载和上传数据。它封装了HTTP协议的基本操作,使得...

    C# WebClient 上传文件

    C#语言提供了多种方法来实现这一功能,其中`WebClient`类就是一种非常简便的方式。本文将详细介绍如何使用`WebClient`类上传文件,并对代码进行深入解析。 #### 二、`WebClient`类简介 `WebClient`是.NET Framework...

    WebClient方式 上传数据到服务器 IIS发布网站

    以下是一个简单的C#代码示例,展示了如何使用`WebClient`上传文件到IIS服务器: ```csharp using System; using System.IO; using System.Net; public class Program { public static void Main() { string url...

    C#通过webclient下载demo

    - **错误处理**:`WebClient`的下载方法可能会抛出异常,如`WebException`,因此在实际应用中,应添加适当的异常处理代码。 - **取消下载**:可以通过调用`WebClient`的`CancelAsync()`方法取消正在进行的下载任务...

    C#中WebClient实现文件下载

    在C#编程中,WebClient类提供了一种简单的方式来实现文件下载。WebClient是一个高度封装的网络通信类,主要用于HTTP协议交互,包括上传和下载数据。以下是对标题和描述中涉及知识点的详细解释: 1. **WebClient下载...

    WebClient访问间歇性返回403解决方案.docx

    WebClient 是一个常用的网络访问类,它可以模拟浏览器的行为来访问网页。然而,在某些情况下,WebClient 访问间歇性返回 403 错误,这种情况非常让人讨厌。 分析错误信息,我们可以发现,403 错误是由于权限设置...

Global site tag (gtag.js) - Google Analytics