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


推荐阅读
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • 本文详细介绍了 GWT 中 PopupPanel 类的 onKeyDownPreview 方法,提供了多个代码示例及应用场景,帮助开发者更好地理解和使用该方法。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • MQTT技术周报:硬件连接与协议解析
    本周开发笔记重点介绍了在新项目中使用MQTT协议进行硬件连接的技术细节,涵盖其特性、原理及实现步骤。 ... [详细]
  • 本文详细解析了Python中的os和sys模块,介绍了它们的功能、常用方法及其在实际编程中的应用。 ... [详细]
  • RecyclerView初步学习(一)
    RecyclerView初步学习(一)ReCyclerView提供了一种插件式的编程模式,除了提供ViewHolder缓存模式,还可以自定义动画,分割符,布局样式,相比于传统的ListVi ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 本文详细介绍如何使用Python进行配置文件的读写操作,涵盖常见的配置文件格式(如INI、JSON、TOML和YAML),并提供具体的代码示例。 ... [详细]
  • 技术分享:从动态网站提取站点密钥的解决方案
    本文探讨了如何从动态网站中提取站点密钥,特别是针对验证码(reCAPTCHA)的处理方法。通过结合Selenium和requests库,提供了详细的代码示例和优化建议。 ... [详细]
  • 在使用 DataGridView 时,如果在当前单元格中输入内容但光标未移开,点击保存按钮后,输入的内容可能无法保存。只有当光标离开单元格后,才能成功保存数据。本文将探讨如何通过调用 DataGridView 的内置方法解决此问题。 ... [详细]
  • 掌握远程执行Linux脚本和命令的技巧
    本文将详细介绍如何利用Python的Paramiko库实现远程执行Linux脚本和命令,帮助读者快速掌握这一实用技能。通过具体的示例和详尽的解释,让初学者也能轻松上手。 ... [详细]
  • 本文介绍如何在 Android 中通过代码模拟用户的点击和滑动操作,包括参数说明、事件生成及处理逻辑。详细解析了视图(View)对象、坐标偏移量以及不同类型的滑动方式。 ... [详细]
  • 本章将深入探讨移动 UI 设计的核心原则,帮助开发者构建简洁、高效且用户友好的界面。通过学习设计规则和用户体验优化技巧,您将能够创建出既美观又实用的移动应用。 ... [详细]
  • 高效提取PDF页面的实用技巧
    在学习和工作中,我们经常需要与他人共享PDF格式的资料。然而,有时只需要分享部分内容,而不仅仅是整个文档。本文将介绍如何使用福昕阅读器领鲜版高效地提取PDF页面,以提高文件传输效率和查阅便捷性。 ... [详细]
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社区 版权所有