首页 > Web开发 > 详细

SAP WebClient UI开发工具中attribute文件夹展开的实现原理分析

时间:2020-08-29 13:53:17      阅读:94      评论:0      收藏:0      [点我收藏+]

For project reason I need to figure out the logic how the field list is assembled when folder “Attributes” for a given context node is expanded in CRM WebClient UI workbench:

技术分享图片

Debugging entry point is CL_BSP_WD_GUI_LIST_TREE~ON_EXPAND_NO_CHILDREN:

技术分享图片

There are three kinds of fields which will appear under “Attributes” folder:

(1) direct attribute

get the public method list of context node class with naming convention that method name starts with GET_, and have one importing parameter ATTRIBUTE_PATH and one returning parameter VALUE.

技术分享图片

And then extract the attribute name and stored it to internal table lt_direct_attribute.

技术分享图片

Once the direct attribute of the current context node class has been extracted, there is a recursive call with the same extraction logic on the super class.

技术分享图片

Since I am using UI component BT116H_SRVO, context node BTADMH to debug, the inheritance hierarchy from children to parent in this example is:
CL_BT116H_S_DETAILS_CN00 -> CL_CRM_UIU_BTADMINH_CN -> CL_CRM_UIU_BT_EASYCNDENTRY_FCN -> CL_BSP_WD_CONTEXT_NODE -> CL_BSP_MODEL
For example, there is a method GET_BILL_BLOCK_STATUS with the specified signature,

技术分享图片

so BILL_BLOCK_STATUS is regarded as one direct attribute for this context node:

技术分享图片

(2) implicit attribute
Retrieved from method get_implicite_cnode_attr,

技术分享图片

Attributes defined in DDIC structure CRMST_ADMINH_BTIL are regarded as implicit attribute.

技术分享图片

This structure is bound to context node BTAdminH in Genil model editor.

技术分享图片

(3) AET attribute ( Application Enhancement Tool )

In fact AET attribute could be regarded as a special kind of implicit attribute as it is physically appended to EEW structure just the same way as implicit attribute. AET fields are retrieved via method get_extension_cnode_attr:

技术分享图片

Those fields are retrieved with API cl_axt_uif_access=>get_ext_attributes and marked with prefix EXT in UI component workbench:

技术分享图片
技术分享图片

You can use the following report to print out the attribute list of a given UI component’s context node:

REPORT zget_ui_context_node_attr.

PARAMETERS: comp TYPE string OBLIGATORY DEFAULT ‘BT116H_SRVO‘,
            cs   TYPE string OBLIGATORY DEFAULT ‘CL_BT116H_S_DETAILS_CN00‘.

DATA(lo_model) = cl_bsp_wd_appl_model=>get_appl_model(
      EXPORTING  iv_bsp_appl = CONV #( comp )
                  iv_model_type      = ‘CL_BSP_WD_APPL_MODEL_DDIC‘ ).
DATA(lt_attr) = lo_model->get_context_node_attr( iv_context_node_class  = CONV #( cs )
  iv_mark_ext_attributes = ‘X‘ ).

LOOP AT lt_attr ASSIGNING FIELD-SYMBOL(<attr>).
  WRITE:/ <attr>.
ENDLOOP.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
技术分享图片

SAP WebClient UI开发工具中attribute文件夹展开的实现原理分析

原文:https://www.cnblogs.com/sap-jerry/p/13581885.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!