有标准配置点,如配置点不能满足可以增强。在特定资产交易类型会计凭证过账时触发,AS02保存也会触发
位置
隐式增强,在ASSET_MASTER_RECORD_UPDATE开头,修改资产都会进来(如果ZCZ过账第一次进来后面不会重复进来了)
demo
ENHANCEMENT 1 .
data lt_bseg type table of bseg.
field-symbols <lt_bseg> type any table.
assign ('(SAPLFACG)T_BSEG[]') to <lt_bseg>.
if sy-subrc = 0.
lt_bseg = <lt_bseg>.
select *
from ztfi052
into table @data(lt_ztfi052).
loop at lt_bseg into data(ls_bseg).
if ls_bseg-anbwa = 'ZCZ'.
read table lt_ztfi052 transporting no fields with key bukrs = ls_bseg-bukrs.
if sy-subrc = 0.
data(lv_flag) = 'X'.
exit.
endif.
endif.
endloop.
endif.
if lv_flag = 'X'.
loop at t_anlb_ges into data(ls_anlb_ges)
where ( afabe = '11' or afabe = '31' or afabe = '41' ) .
if ls_bseg-gjahr = ls_anlb_ges-vyear.
ls_anlb_ges-umjar = ls_bseg-gjahr + 1.
elseif ls_bseg-gjahr > ls_anlb_ges-vyear.
ls_anlb_ges-umjar = ls_bseg-gjahr .
endif.
modify t_anlb_ges from ls_anlb_ges.
endloop.
endif.
ENDENHANCEMENT.