热门标签 | 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中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 本文介绍了使用kotlin实现动画效果的方法,包括上下移动、放大缩小、旋转等功能。通过代码示例演示了如何使用ObjectAnimator和AnimatorSet来实现动画效果,并提供了实现抖动效果的代码。同时还介绍了如何使用translationY和translationX来实现上下和左右移动的效果。最后还提供了一个anim_small.xml文件的代码示例,可以用来实现放大缩小的效果。 ... [详细]
  • 云原生边缘计算之KubeEdge简介及功能特点
    本文介绍了云原生边缘计算中的KubeEdge系统,该系统是一个开源系统,用于将容器化应用程序编排功能扩展到Edge的主机。它基于Kubernetes构建,并为网络应用程序提供基础架构支持。同时,KubeEdge具有离线模式、基于Kubernetes的节点、群集、应用程序和设备管理、资源优化等特点。此外,KubeEdge还支持跨平台工作,在私有、公共和混合云中都可以运行。同时,KubeEdge还提供数据管理和数据分析管道引擎的支持。最后,本文还介绍了KubeEdge系统生成证书的方法。 ... [详细]
  • IhaveconfiguredanactionforaremotenotificationwhenitarrivestomyiOsapp.Iwanttwodiff ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
  • 深入理解Kafka服务端请求队列中请求的处理
    本文深入分析了Kafka服务端请求队列中请求的处理过程,详细介绍了请求的封装和放入请求队列的过程,以及处理请求的线程池的创建和容量设置。通过场景分析、图示说明和源码分析,帮助读者更好地理解Kafka服务端的工作原理。 ... [详细]
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社区 版权所有