如何自行分析定位SAP BSP错误-阿里云开发者社区

开发者社区> jerrywangsap> 正文

如何自行分析定位SAP BSP错误

简介: 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.
+关注继续查看

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.


image.png


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,


image.png


However in the UI the table toolbar is missing.


image.png


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.


image.png


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.


image.png


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.


image.png


(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:


image.png


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


image.png


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


image.png


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.


image.png


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


image.png


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.


image.png


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.


image.png


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:


image.png


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.



image.png

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

Only one result hit:


image.png


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


image.png


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.


image.png


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.


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
Alluxio源码分析定位策略:指定主机策略SpecificHostPolicy
        指定主机策略SpecificHostPolicy是一种总是返回一个指定主机名的worker的定位策略。如果在那个主机名对应机器上没有活跃worker的话则返回null。在SpecificHostPolicy内部,封装了一个成员变量,如下: // 主机名 priva...
738 0
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
8323 0
Alluxio源码分析定位策略:本地优先策略LocalFirstPolicy
        LocalFirstPolicy是一个优先返回本地主机的定位策略,如果本地worker没有足够的容量,那么就会从活跃有效的workers列表随机选择一个worker用于每个块写入。
878 0
如何自行分析定位SAP BSP错误
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.
10 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,大概有三种登录方式:
2736 0
Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
http://yulimin.javaeye.com/blog/129015 同样的程序在 Tomcat 5.5.16/25 以及 Jetty 5.1.12 上都能够成功部署及运行,但是部署到 WebLogic 9.2 上时出错 org.springframework.web.context.ContextLoader initWebApplicationContext FATAL: Con
1299 0
ECS资源下载慢 ,如何分析定位?
我们来结合最近发生的一个真实的用户案例——ECS上的资源下载速度被限,来看看针对资源下载慢的问题,如何根据现有的情况一步步进行分析和定位。
5202 0
Alluxio源码分析定位策略:循环遍历策略RoundRobinPolicy
        循环遍历策略RoundRobinPolicy是一种通过循环遍历方式并且跳过没有足够空间workers的为下一个数据块选择worker的策略。如果没有worker被找到,该策略会返回null。
888 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
11369 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,云吞铺子总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系统盘、创建快照、配置安全组等操作如何登录ECS云服务器控制台? 1、先登录到阿里云ECS服务器控制台 2、点击顶部的“控制台” 3、通过左侧栏,切换到“云服务器ECS”即可,如下图所示 通过ECS控制台的远程连接来登录到云服务器 阿里云ECS云服务器自带远程连接功能,使用该功能可以登录到云服务器,简单且方便,如下图:点击“远程连接”,第一次连接会自动生成6位数字密码,输入密码即可登录到云服务器上。
21480 0
+关注
2627
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载