在KO88結算成本之後,對特定的內部訂單型別,替換預設的統馭科目
阿新 • • 發佈:2021-11-11
程式碼參考:
ENHANCEMENT1ZEN_KO88."activeversion * *BREAKDS01. DATA:e_aufkTYPEAUFK, LR_co_acdoc_post_dataTypeRefToCL_FINS_ACDOC_POST_DATA, LR_IO_ACDOC_DATATYPERefToCL_FINS_ACDOC_DATA, LT_ACDOC_ITEMTYPEFINST_ACDOC_ITEM. IMPORTe_aufkTOe_aufkFROMMEMORYID'KO88'. IFe_aufk-AUART='11111111'. LR_IO_ACDOC_DATAView Code=co_acdoc_post_data->MO_ACDOC_DATA. LT_ACDOC_ITEM=LR_IO_ACDOC_DATA->MT_ACDOC_ITEM. LOOPATLT_ACDOC_ITEMASSIGNINGFIELD-SYMBOL(<FS_ITEM>). CASE<FS_ITEM>-KOART. WHEN'D'. SELECTSINGLEBU_GROUPINTO@DATA(V_BU_GROUP)FROMBUT000WHEREPARTNER=@<FS_ITEM>-KUNNR. IFV_BU_GROUP='Z003'. <FS_ITEM>-HKONT='11111111'. ELSEIFV_BU_GROUP='Z004'. <FS_ITEM>-HKONT='11111111'. ENDIF. <FS_ITEM>-ALTKT='0012310000'. WHEN'K'. SELECTSINGLEBU_GROUPINTOV_BU_GROUPFROMBUT000WHEREPARTNER=<FS_ITEM>-LIFNR. IFV_BU_GROUP='Z003'. <FS_ITEM>-HKONT='111111111'. ELSEIFV_BU_GROUP='Z004'. <FS_ITEM>-HKONT='111111111'. ENDIF. <FS_ITEM>-ALTKT='011111111'. WHENOTHERS. 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)