版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons)
In loyalty management, even after new field is created via application extension tool and does not mark it as “display only”, still it is not editable.
The edit control on those fields is done in method IF_LOY_FRW_PROPERTY_OBJECT~GET_PROPERTY. Only fields listed in the method are marked as editable.
Fortunately there is a BAdI call to allow the field properties to be changed in a custom way.
Create a new BAdI implementation in Customer Relationship Management->Marketing->Loyalty Management->Business Add-Ins for Loyalty Management->BAdI:Membership Save
implement the method below in your enhancement implementation:
METHOD if_loy_frw_property_object~get_property.
DATA: ls_field_property TYPE loys_frw_field_property ,
lt_prop_table TYPE TABLE OF loys_frw_field_property,
ls_obj_field_property TYPE loys_frw_obj_field_property,
lv_object_name TYPE loy_frw_object.
FIELD-SYMBOLS: <ls_value_x> TYPE any,
<fs_obj_field_property> TYPE loys_frw_obj_field_property.
ASSIGN COMPONENT if_loy_msh_constants=>gc_msh_guid OF STRUCTURE is_data TO <ls_value_x>.
lv_object_name = ir_object->mv_object.
READ TABLE et_property WITH TABLE KEY guid = <ls_value_x> ASSIGNING <fs_obj_field_property>.
CASE lv_object_name.
WHEN if_loy_msh_constants=>gc_mshbolobj_mems. " Membership
ls_field_property-field_name = 'ZZBFLD0000OW'.
ls_field_property-property = if_loy_msh_constants=>gc_field_property.
INSERT ls_field_property INTO TABLE <fs_obj_field_property>-property.
WHEN if_loy_msh_constants=>gc_mshbolobj_memsmemb. " Membership Member( MEMSMEMB) Link Object.
WHEN if_loy_msh_constants=>gc_mshobolobj_mems. " Org Membership
ENDCASE.
ENDMETHOD.
now the extension field is editable.