分类: Web开发
2018-09-23 15:27:43
问题点: 增强字段不能编辑,不能编辑,不能查询,查询结果不显示。
解决方法:
1, 增强BADI 。
appellation: Membership BADI: LOY_MSH_MEMBERSHIP_SAVE
appellation: Point Account BADI: LOY_PT_ACCT_SAVE LOY_PT_ACCT_SET_SAVE
appellation: Member Activity BADI: LOY_MA_GENATTR_PROP
举例: Membership。
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:
ASSIGN COMPONENT if_loy_msh_constants=>gc_msh_guid OF STRUCTURE is_data TO
lv_object_name = ir_object->mv_object.
READ TABLE et_property WITH TABLE KEY guid =
CASE lv_object_name.
WHEN if_loy_msh_constants=>gc_mshbolobj_mems. " Membership
ls_field_property-FIELD_NAME = 'ZZFLD0000EG'.
ls_field_property-PROPERTY = IF_LOY_MSH_CONSTANTS=>GC_FIELD_PROPERTY.
INSERT ls_field_property INTO TABLE
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.
2 维护查询表LOYC_FRW_EX_SMPR,参考标准表LOYC_FRW_SRCHMPR
ls_search-application = 'MSH' .
ls_search-srch_object = 'MSHSEARCH' .
ls_search-srch_attr_name = 'ZZAFLD000004' .
ls_search-srch_tab_name = 'LOYD_MSH_MEMS' .
ls_search-srch_fld_name = 'ZZAFLD000004' .
APPEND ls_search TO lt_search .
IF lt_search[] IS NOT INITIAL .
MODIFY loyc_frw_ex_smpr FROM TABLE lt_search .
ENDIF.
3 维护结果表LOYC_FRW_EX_SRSM,参考标准表LOYC_FRW_SRCHRSM
ls_result-application = 'MSH' .
ls_result-srch_object = 'MSHSEARCH' .
ls_result-rslt_attr_name = 'ZZAFLD000004' .
ls_result-rslt_obj_name = 'MEMBERSHIP' .
ls_result-rslt_fld_name = 'ZZAFLD000004' .
APPEND ls_result TO lt_result .
IF lt_result[] IS NOT INITIAL .
MODIFY loyc_frw_ex_srsm FROM TABLE lt_result .
ENDIF.