热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何自行分析定位SAPBSP错误

The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi

The “BSP tag” I mentioned in the blog title means for example the tag chtmlb:configCellerator below which is pre-delivered by SAP and you could include it in your UI component view to draw various UI element.

In this blog I will share with you a real issue I meet with when I am using configCellerator and how I find the root cause. So sometimes if you find the behavior of BSP tag is not working as you expected, if time allowed, you can spend sometime to investigate by yourself. Such investigation will make you understand how native html is rendered based on those BSP tag more thoroughly.


Issue1 – Missing table toolbar

Although the entry for table toolbar is found in debugger,

However in the UI the table toolbar is missing.

I guess the issue might be related to attribute “editMode” set in line 12. I try to find documentation on this attribute in SE80 but unfortunately there is not.

Then double click on line 6 ( the first screenshot in this blog) “configCellerator”, in the new screen click tab “Attribute”, now I get to know the possible value for editMode is NONE, SINGLE and ALL. However still I don’t know the clear meaning of these three values.

So below is how I investigate on the usage of attribute “editMode”:

(1) Do observation on the callstack of UI rendering and I find framework is using CL_THTMLB_CELLERATOR to render the table defined via configCellerator.

(2) run report RS_ABAP_SOURCE_SCAN, search key word EDITMODE against class CL_THTMLB_CELLERATOR found in step 1.
Navigate to the source code of the third hit:

it means if the editmode is set as NONE, the member attribute NOHEADER of class CL_THTMLB_CELLERATOR is set as TRUE.

(2.1) rerun report RS_ABAP_SOURCE_SCAN but this time search keyword NOHEADER instead ( or you can also use where used list on member attribute NOHEADER in SE24 ). The hit shows that the string “TRUE”( or “FALSE”) stored in member attribute NOHEADER is converted to abap boolean and stored in variable gv_no_header.

2.2 repeat the step 2 and 2.1, search keyword gv_no_header. The third hit demonstrates the table toolbar could only be rendered if gv_no_header is abap_false ( and other condition between line 10 and 14 are fulfilled ). The html source is the final native html code rendered by UI framework.

After I remove the editMode attribute and I could see the expected table toolbar.

I view the source code of my table view and I could find the hard coded html code in the line 17 of screenshot above. And the html code for toolbar title is just very next to it. So this issue is just resolved without debugging, but just pure source code analysis in the design time.


Issue2 – Do not expect the table cell editable

In my project I need to switch the BOL entity to change mode, however I do not want to make each table cell be editable, instead user will edit the locked object in another UI and see result after edit in the table view. In the table view I expect each cell is read only.

My BOL model has 40 attributes and I would not like to code “rv_disabled = TRUE” 40 times in each GET_I_ method.

I plan to investigate the attribute usage = “ASSIGNMENTBLOCK”

Here below is my analysis process:

(1) run report RS_ABAP_SOURCE_SCAN, search keyword ASSIGNMENTBLOCK, class CL_THTMLB_CELLERATOR – no result

(2) double click tag configCellerator, then find the element handler class name:

then run report again and change the search class to CL_CHTMLB_CONFIG_CELLERATOR.
only one result which points to the commented out code. Just ignore it.

(3) find all possible value for usage attribute here, and run report again with search keyword = “SEARCHRESULT”:
Only one result hit:

and the code indicates that the usage attribute “SEARCHRESULT” will set the whole table to read only mode.

After I change the attribute and test the table cells are rendered as read only as I expect.


Summary

In some case it might be possible that you can not get quite promising result by the first RS_ABAP_SOURCE_SCAN execution.

The tip is how to specify search keyword and search class ( or package, report etc ) cleverly so that the search result are relevant and helpful for your further investigation. Usually it would take several iterations before you reach your target, as are shown in my two examples in this blog.

My common experience to specify search selection for report RS_ABAP_SOURCE_SCAN is:
(1) Try to find the very class ( or report, function group etc ) which is relevant. If it is difficult to identify the exact one, use * for example “CL_CHTMLB*”.
(2) Find the package name of the class( or report, function group etc ), and run report against the package instead.


Reference

there is a useful blog written by Andrei Vishnevsky about creating a new BSP tag and its corresponding element handler class. By reading it you will get a deeper understanding how the element handler class takes part in the UI render process.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":


推荐阅读
  • 教程:使用Source Monitor进行代码质量分析
    Source Monitor 是一款强大的代码分析工具,能够对 Java、C++、C、C# 和 Delphi 等多种编程语言进行复杂度分析,帮助开发者有效评估和提升代码质量。通过详细的指标和报告,该工具可辅助团队识别潜在问题并优化代码结构。 ... [详细]
  • 本文深入探讨了 AdoDataSet RecordSet 的序列化与反序列化技术,详细解析了将 RecordSet 转换为 XML 格式的方法。通过使用 Variant 类型变量和 TStringStream 流对象,实现数据集的高效转换与存储。该方法不仅提高了数据传输的灵活性,还增强了数据处理的兼容性和可扩展性。 ... [详细]
  • 探讨 javax.jms.JMSException 中 getLocalizedMessage 方法的应用与实例代码分析 ... [详细]
  • 本研究聚焦于智能图库管理和高清摄影功能的优化。通过集成系统预设的多媒体参数,利用 `UIImagePickerController` 实现了高效的拍照和系统相册访问功能。系统会自动检测设备的兼容性,并提供用户友好的界面以确保最佳的使用体验。此外,我们还引入了先进的图像处理算法,进一步提升了照片质量和存储效率。 ... [详细]
  • 【高效构建全面的iOS直播应用】(美颜功能深度解析)
    本文深入探讨了如何高效构建全面的iOS直播应用,特别聚焦于美颜功能的技术实现。通过详细解析美颜算法和优化策略,帮助开发者快速掌握关键技术和实现方法,提升用户体验。适合对直播应用开发感兴趣的开发者阅读。 ... [详细]
  • 本文深入探讨了Windows操作系统中线程同步机制的关键技术,重点分析了`WaitForSingleObject`和`Event`的使用方法及其应用场景。通过详细介绍`CreateEvent`函数的创建过程及其在判断线程退出和实现线程间同步中的重要作用,结合具体实例,展示了如何高效地利用这些工具来解决多线程编程中的常见问题。此外,文章还讨论了这些机制在实际开发中的最佳实践和注意事项,为开发者提供了宝贵的参考。 ... [详细]
  • 多进程程序异常退出问题分析与解决 ... [详细]
  • Python初学者入门指南:从基础到实践的全面学习路径本文为Python初学者提供了一条从基础到实践的全面学习路径。特别介绍了Python字典(Dictionary)中的`items()`方法,该方法用于返回字典中所有键值对的视图对象,便于在循环和其他操作中使用。通过实例讲解,帮助读者更好地理解和应用这一重要功能。 ... [详细]
  • 一张思维导图带你梳理HashMap相关知识
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • Tornado硬件管理平台中的设备信息采集技术深入解析(三)
    深入解析 Tornado 硬件管理平台中的设备信息采集技术,本文聚焦于 `monitor.py` 脚本的关键字段分析。该脚本通过导入 `psutil`、`time` 和 `datetime` 模块,以及使用 `pprint` 进行数据格式化输出,实现对系统资源和设备状态的高效监控与数据采集。 ... [详细]
  • 在 Asp.net 应用中,动态加载 DropDownList 控件的数据源是一项常见需求。本文探讨了如何高效地从数据库中获取数据,并实时更新下拉列表,确保用户界面始终与后台数据保持同步。通过使用 ADO.NET 和 LINQ to SQL 技术,开发者可以轻松实现这一功能,同时提高应用的性能和用户体验。文中还提供了代码示例和最佳实践,帮助开发者解决常见的数据绑定问题。 ... [详细]
  • 在JSP页面中调用客户端本地应用程序(例如 `C:\netterm.exe`)时,可以通过使用 `Runtime.getRuntime().exec("c:\\netterm.exe")` 实现。然而,这种方法仅在服务器端有效,若要实现在客户端执行本地程序,需要采用其他技术手段,如Java Applet或ActiveX控件,以确保安全性和兼容性。 ... [详细]
  • 在解决Android应用程序中的ANR问题时,我引入了StrictMode机制。尽管之前未曾使用过这一工具,但通过实践发现它能有效检测并定位性能瓶颈。日志中出现的两个违规记录,除了前四行信息和持续时间存在差异外,还可能涉及不同的线程或操作类型。深入理解这些差异有助于更好地优化应用性能。 ... [详细]
  • 在 Linux 环境下,深入探讨 GTK+3.0 的高级开发技巧,涵盖组件定制、事件处理及多线程应用等核心内容,帮助开发者提升应用界面的交互性和性能。 ... [详细]
  • 本文详细解析了J19标准中集合对象的Map接口,深入探讨了其核心功能与应用场景。Map接口用于将唯一键映射到相应的值,确保每个键在映射中唯一且仅能对应一个值。此外,文章还对比了Map接口与Collection接口的主要区别,强调了Map作为双列数据结构的特点,为开发者提供了更加全面的理解和实用指导。 ... [详细]
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有