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”.
REPORT zbsp.CONSTANTS: cv_host TYPE o2applname VALUE 'BT116H_SRVO'.DATA: lt_enh_sets TYPE bsp_dlct_ehset,
ls_enh_set LIKE LINE OF lt_enh_sets,
lt_extension TYPE STANDARD TABLE OF bspwd_comp_ext,
ls_extension LIKE LINE OF lt_extension,
lt_usages TYPE bsp_wd_cmp_usage_descr_tab,
ls_usage LIKE LINE OF lt_usages.lt_enh_sets = cl_bsp_dlc_config_util=>get_eh_sets_of_comp( iv_comp_name = cv_host ).CHECK lt_enh_sets IS NOT INITIAL.SELECT * INTO TABLE lt_extension FROM bspwd_comp_ext FOR ALL ENTRIES IN lt_enh_sets WHERE
enhancement_set = lt_enh_sets-enhancement_set AND comp_name = cv_host.LOOP AT lt_enh_sets INTO ls_enh_set.
READ TABLE lt_extension INTO ls_extension WITH KEY enhancement_set = ls_enh_set-enhancement_set comp_name = cv_host.
IF sy-subrc = 0.
CLEAR: lt_usages.
CALL METHOD zcl_view_repo_tool=>get_repo_metadata(
EXPORTING
iv_comp_name = ls_extension-bsp_appl
iv_page_name = ls_extension-rt_rep_page
IMPORTING
et_usages = lt_usages ).
READ TABLE lt_usages WITH KEY usage_name = 'ZCUSTOM' INTO ls_usage.
IF sy-subrc = 0.
WRITE: / 'EnhancementSet: ', ls_enh_set-enhancement_set,
' defines component usage to component: ', ls_usage-child_cmp_type.
ENDIF.
ENDIF.ENDLOOP.
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_navlink
WITH NON-UNIQUE KEY name
INITIAL 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_up
WITH UNIQUE KEY name
INITIAL SIZE 0,
op_mappings TYPE HASHED TABLE OF gtype_op_mapping
WITH UNIQUE KEY name
INITIAL SIZE 0,
sfw_data TYPE bsp_wd_sfw_data BOXED,
END OF gtype_viewline .TYPES:
ltype_view_tab TYPE HASHED TABLE OF ltype_viewline
WITH UNIQUE KEY view active
INITIAL 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 = name
iv_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 memoryCALL TRANSFORMATION bsp_wd_rt_rep_runtime
SOURCE XML lv_xml
RESULT views = lt_views
rootview = lv_root
usages = lt_usages.BREAK-POINT.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2713195/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP WebClient UI component context node class單元測試方法WebclientUIContext
- SAP CRM WebClient UI cross component跳轉的一個具體例子WebclientUIROS
- SAP UI5 Theme Library 的解析邏輯和 SAP UI5 配置後設資料的預設值UI
- SAP WebClient UI的白屏問題分析WebclientUI
- 如何在SAP WebClient UI裡使用jChartFXWebclientUI
- 使用note++開發SAP WebClient UIWebclientUI
- 在SAP WebClient UI裡使用AJAX進行非同步資料讀取WebclientUI非同步
- SAP CRM WebClient UI和Fiori UI混搭並存WebclientUI
- SAP WebClient UI的會話重啟原理WebclientUI會話
- SAP UI5 應用的 OData 後設資料請求響應的解析原理分析UI
- 在SAP WebClient UI裡顯示倒數計時的UIWebclientUI
- SAP UI5 應用的 OData XML 格式的後設資料請求解析原理,基於 DOMParserUIXML
- SAP CRM WebClient UI上將text area裡的文字清空的後臺處理WebclientUI
- SAP CRM WebClient UI異常的持久化機制WebclientUI持久化
- 將SAP CRM WebClient UI的表格匯出成PDFWebclientUI
- 如何將SAP WebClient UI的表格匯出成PDFWebclientUI
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 如何在SAP WebClient UI裡使用HANA Live reportWebclientUI
- SAP WebClient UI One Hit Navigation的實現方法WebclientUINavigation
- SAP CRM WebClient UI和Hybris backoffice UI開發的相同點WebclientUI
- 使用Selenium自動化測試SAP CRM WebClient UIWebclientUI
- SAP CRM WebClient UI的Delta處理機制介紹WebclientUI
- 在SAP CRM WebClient UI裡開啟ABAP Webdynpro頁面WebclientUI
- SAP CRM WebClient UI和ABAP Webdynpro頁面的互相跳轉WebclientUI
- SAP CRM WebClient UI html 格式的 Text 顯示邏輯WebclientUIHTML
- 使用SAP Transaction Launcher將ABAP Webdynpro嵌入到WebClient UI中WebclientUI
- 如何在SAP WebClient UI裡建立柱狀圖(bar chart)WebclientUI
- 自己實現一個SAP WebClient UI Repository Information SystemWebclientUIORM
- SAP CRM WebClient UI 支援的一些 url 引數WebclientUI
- 深入學習SAP UI5框架程式碼系列之四:SAP UI5控制元件的後設資料實現UI框架控制元件
- SAP CRM WebClient UI的on_new_focus應該怎麼理解WebclientUI
- SAP CRM WebClient UI表格編輯模式的除錯明細WebclientUI模式除錯
- SAP CRM WebClient UI Text Type 顯示的過濾邏輯WebclientUI
- SAP WebClient UI和business switch相關的邏輯介紹WebclientUI
- SAP UI5 Web Component的圖示實現UIWeb
- SAP Fiori和WebClient UI的有狀態和無狀態行為設計原理WebclientUI
- SAP UI5 Web Component React應用如何在Component之間跳轉UIWebReact
- SAP CRM WebClient UI Text 可編輯與否的控制邏輯WebclientUI