SAP WebClient UI component模型元数据解析工具
I use the issue in this blog to demonstrate the usage of this small repository parse tool:
We need to know under which enhancement set the component usage “ZCUSTOM” is added to UI component BT116H_SRVO.
This customizing activity could allow us to compare the runtime repository between the original UI component and the enhanced one:
However, if there are too many enhancement sets in the system, it could be very inefficient for manual comparison.
Fortunately the comparison could be done by code below.
The report is quite simple:
(1) in line 9, get all enhancement sets list under which the UI component is enhanced.
(2) get the enhanced BSP application name and page name in line 11 and 12, then get the component usage information for each enhanced BSP application via repository tool, then filter it by usage name “ZCUSTOM”.
The small parse tool zcl_view_repo_tool just parse the repository xml from database table and convert it to two internal tables which contains the view information and component usage information. Its source code could be found in attachment.
We can compare the report execution result and the manual check via customizing activity: they are exactly the same.
Update on 2017-06-02 14:45PM
It seems the source code in attachment is lost after SCN is migrated to SAP community. Please use the following report instead:
REPORT tool_bsp_metadata.PARAMETERS: name TYPE o2applname DEFAULT 'SMCHS'.TYPES ltype_viewline TYPE cl_bsp_wd_rep_view=>gtype_viewline . TYPES:BEGIN OF gtype_op_mapping,name TYPE string,op_plug TYPE string,switch_id TYPE sfw_switch_id,reaction TYPE sfw_showhide,END OF gtype_op_mapping .TYPES:BEGIN OF gtype_ip_follow_up,name TYPE string,navlink TYPE string,switch_id TYPE sfw_switch_id,reaction TYPE sfw_showhide,END OF gtype_ip_follow_up .TYPES:BEGIN OF gtype_navlink,name TYPE string,targets_done TYPE flag,targets TYPE tbsp_wd_rep_navigation_targets,sfw_data TYPE bsp_wd_sfw_data BOXED,END OF gtype_navlink .TYPES:BEGIN OF gtype_viewline,view TYPE string,active TYPE abap_bool,view_id TYPE n LENGTH 4,parent_viewset TYPE string,parent_viewarea TYPE string,parent TYPE REF TO cl_bsp_wd_rep_view,initials TYPE tbsp_wd_rep_viewarea_assigns,initials_done TYPE abap_bool,navlinks TYPE SORTED TABLE OF gtype_navlinkWITH NON-UNIQUE KEY nameINITIAL SIZE 0,rep_view TYPE REF TO cl_bsp_wd_rep_view,is_window TYPE abap_bool,is_intf_view TYPE abap_bool,is_default_window TYPE abap_bool,ip_follow_ups TYPE HASHED TABLE OF gtype_ip_follow_upWITH UNIQUE KEY nameINITIAL SIZE 0,op_mappings TYPE HASHED TABLE OF gtype_op_mappingWITH UNIQUE KEY nameINITIAL SIZE 0,sfw_data TYPE bsp_wd_sfw_data BOXED,END OF gtype_viewline .TYPES:ltype_view_tab TYPE HASHED TABLE OF ltype_viewlineWITH UNIQUE KEY view activeINITIAL SIZE 0 .DATA: lv_loader TYPE REF TO cl_bsp_wd_stream_loader,lv_xml TYPE string,lv_root TYPE string.CREATE OBJECT lv_loader. lv_xml = lv_loader->load_from_bsp_page( iv_bsp_appl = nameiv_bsp_page = 'Repository.xml' ). "#EC NOTEXTDATA: lt_views TYPE ltype_view_tab,lt_usages TYPE bsp_wd_cmp_usage_descr_tab,result TYPE REF TO cl_bsp_wd_repository.* "parse" repository xml data directly into memory CALL TRANSFORMATION bsp_wd_rt_rep_runtimeSOURCE XML lv_xmlRESULT views = lt_viewsrootview = lv_rootusages = lt_usages.BREAK-POINT.要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的SAP WebClient UI component模型元数据解析工具的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: iphonexr带双微信吗
- 下一篇: 如何自行分析SAP WebClient