SAP CRM Application Extension Tool的Custom Behavior CRMSAPSAP云平台SAP Cloud PlatformSAP成都研究院
In this blog Insight into calculated fields created by AET
I introduce one approach to define your extension field with your specific logic via calculated field supported in CRM Application Extension Tool ( AET ).
If your logic is too complex to be covered by the embedded formula in calculated field editor in AET, for example there are some ABAP coding involvled, you can try another apporoach:
(1) Create a new entry in table AXT_BEHAVIOR
(2) Your custom behavior could be implemented in class ZCL_AXT_CUSTOM_BEHAVIOR, which inherites from class CL_AXT_ABST_BEHAVIOR_HDLR. Depending on your logic, different methods must be redefined.
For my requirement, I just would like to add a timestamp each time the extension field is maintained, so I have to only redefine the following methods. a. define the appearance of extension field:
METHOD IF_AXT_DATATYPE_HANDLER~ADJUST_GET_P.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
IF iv_is_table = abap_true OR iv_is_search = abap_true.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_input.
ELSE.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_textarea.
ENDIF.
WHEN if_bsp_wd_model_setter_getter=>fp_textarea_rows.
rv_value = 10.
WHEN OTHERS.
rv_value = super->if_axt_datatype_handler~adjust_get_p(
is_field = is_field
iv_component = iv_component
io_current = io_current
iv_property = iv_property
iv_display_mode = iv_display_mode
iv_original_value = iv_original_value ).
ENDCASE.
ENDMETHOD. "IF_AXT_DATATYPE_HANDLER~ADJUST_GET_P
b. append the timestamp to extension field value
method IF_AXT_DATATYPE_HANDLER~ADJUST_SET.
DATA: tsl TYPE timestampl,
lv_zone type TZONREF-TZONE value 'UTC',
lv_time TYPE string.
GET TIME STAMP FIELD tsl.
lv_time = | Edited by: { tsl TIMESTAMP = ISO
TIMEZONE = lv_zone }|.
CONCATENATE cv_value lv_time INTO cv_value SEPARATED BY cl_abap_char_utilities=>cr_lf.
endmethod.
(3) When you create extension field, choose “Not defined” as Field type, and choose the entry maintained in step1 as “Render/Validate As”:
Click Enable Expert Mode and assign one data element to this extension field:
Generate the extension field and make it visible in WebUI. After I maintain some value for this field and click save:
the ADJUST_SET method of handler class is called and the timestamp is appended:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
推荐阅读
-
Product settype在CRM WebClient UI架构中的地位 SAPCRMSAP成都研究院SAP Cloud PlatformSAP云平台
-
SAP CRM中间件下载时数据库表CRMATAB为空的处理方法 SAP成都研究院SAP Cloud PlatformSAP云平台CRM中间件
-
SAP CRM里产品主数据的文本模型设计 SAP成都研究院SAP Cloud PlatformSAP云平台SAPFiori
-
如何关闭SAP CRM中间件的delta download方式 CRM中间件SAP成都研究院SAP Cloud PlatformSAP云平台
-
使用SAP CRM中间件从ERP下载Customer的错误消息 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
SAP CRM Fiori应用冗余round trip的原因分析 SAP成都研究院SAP Cloud PlatformSAP云平台CRMOData
-
SAP CRM扩展字段的元数据仓库 SAPCRMSAP成都研究院SAP Cloud PlatformSAP云平台
-
使用SAP CRM中间件从ERP下载Customer的错误消息 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
SAP CRM Location Assignment的实现原理 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud
-
SAP 函数CRM_ORDERADM_I_PROD_DETERM_OW的单元测试方法 SAPSAP云平台SAP Cloud PlatformSAP成都研究院Cloud