SAP BSP(Business Server Page)的源代码搜索工具
The source code scan report RS_ABAP_SOURCE_SCAN ( or transaction code CODE_SCANNER ) is a good tool for ABAPers.
In my Webclient UI development life, I would also expect that there is also a similar tool which enable the scan on html source code of ui component view, for example I want to search by keyword “ActiveXObject” to get a list of ActiveX control used in Javascript code.
Why RS_ABAP_SOURCE_SCAN could not support html source code scan
In the beginning I plan to enhance RS_ABAP_SOURCE_SCAN instead of development a new tool. All the objects( class, report, function module) which supported by this tool could have their source code read out via keyword READ REPORT.
this is not the case for handler class of ui component view. Although you could still set breakpoint on the ABAP code in view handler class and debug them,
however they are stored in a difference way than normal ABAP class /report, thus it is not possible to fetch their source code from repository via READ REPORT. Besides that you can easily observe the page editor are quite different from normal ABAP Editor for class/report/function module, which means if I enhance RS_ABAP_SOURCE_SCAN, I also need to enhance the navigation logic after I double click on the result list to see the source code in ABAP editor.
So finally I decide to develop a tool on my own.
Develop a tool to allow scan on UI component view source code
There are only two parameters for code scan: Search keyword and UI component whose BSP view’s html source you expect to scan.
You could specify multiple UI component via selection options:
The search result is displayed in ALV. Double click on result row,
and it will automatically navigate to the BSP view editor with the very line which contains the search keyword being highlighted as below:
This tool has simple input and output UI, but it has already 100% fulfilled my html source code scan requirement.
How to make this tool run on your laptop
create a new Z report and copy the source code from attached text file. This tool contains the following parts:
(1) an executable report zbsp_code_view
(2) a global class ZCL_BSP_CODE_TOOL
(3) a function module ZCALL_EDITOR. Of course you should also have a function group, in my case it is named as zbspeditor.
(4) a new screen 0101 used in FM ZCALL_EDITOR.
Flow logic:
Element list:
layout design:
Feel free to adapt this tool to meet your own requirement
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- [SAP] 38. Database Migration Service
- SAP UI5 Mock server,为什么运行时无法返回 JSON 类型的测试数据?
- 纪念特洛伊英雄 Sinon - SAP UI5 Mock Server 使用步骤和工作原理介绍
- 关于 SAP UI5 对服务器端渲染 Server Sider Render 的支持问题
- 回答一位朋友关于 SAP SRM 行业 转 CRM 行业的咨询
- SAP BSP set server cache via CL_BSP_UTILITY-SET_BROWSER_CACHE
- SAP Server Side JavaScript解决方案
- 关于自定义的登录机制在SAP Spartacus服务器端渲染(SSR)实施过程中遇到的问题
- SAP Spartacus 服务器端渲染(SSR,Server Side Rendering)专题
- Debug a Server–Side Rendered SAP Spartacus Storefront Using Chrome Dev Tools
- SAP Spartacus 服务器端渲染文件 server.js 和构建后的 main.js 对比
- 自己动手开发SAP Spartacus focus Directive的单元测试
- 一个失败的SAP Spartacus路由修改尝试 -在CmsPageGuard的开头触发 OCC API 调用
- SAP Spartacus的Structured data
- SAP Spartacus CmsService.Components数据结构
- 什么是SAP Commerce Server
- SAP CRM WebClient UI BSP server event
- SAP云平台上Redis dashboard提供的功能一览
- Cannot find package module @sap/cds/common
- SAP C4C里嵌入SAP Analytics Cloud的案例
- SAP OData 服务关于本地文件作为附件上传的一些错误消息
- SAP Spartacus 服务器端渲染(SSR,Server Side Rendering)专题