在KO88结算成本之后,对特定的内部订单类型,替换默认的统驭科目
代码参考:
ENHANCEMENT 1 ZEN_KO88. "active version * * BREAK DS01. DATA:e_aufk TYPE AUFK, LR_co_acdoc_post_data Type Ref To CL_FINS_ACDOC_POST_DATA, LR_IO_ACDOC_DATA TYPE Ref To CL_FINS_ACDOC_DATA, LT_ACDOC_ITEM TYPE FINST_ACDOC_ITEM. IMPORT e_aufk TO e_aufk FROM MEMORY ID 'KO88'. IF e_aufk-AUART = '11111111'. LR_IO_ACDOC_DATA = co_acdoc_post_data->MO_ACDOC_DATA. LT_ACDOC_ITEM = LR_IO_ACDOC_DATA->MT_ACDOC_ITEM. LOOP AT LT_ACDOC_ITEM ASSIGNING FIELD-SYMBOL(). CASE -KOART. WHEN 'D'. SELECT SINGLE BU_GROUP INTO @DATA(V_BU_GROUP) FROM BUT000 WHERE PARTNER = @ -KUNNR. IF V_BU_GROUP = 'Z003'. -HKONT = '11111111'. ELSEIF V_BU_GROUP = 'Z004'. -HKONT = '11111111'. ENDIF. -ALTKT = '0012310000'. WHEN 'K'. SELECT SINGLE BU_GROUP INTO V_BU_GROUP FROM BUT000 WHERE PARTNER = -LIFNR. IF V_BU_GROUP = 'Z003'. -HKONT = '111111111'. ELSEIF V_BU_GROUP = 'Z004'. -HKONT = '111111111'. ENDIF. -ALTKT = '011111111'. WHEN OTHERS. ENDCASE. ENDLOOP. LR_IO_ACDOC_DATA->MT_ACDOC_ITEM = LT_ACDOC_ITEM. co_acdoc_post_data->MO_ACDOC_DATA = LR_IO_ACDOC_DATA. ENDIF. ENDENHANCEMENT.
2)