使用 BAPI_ACC_DOCUMENT_REV_POST 反转通过 BAPI_ACC_DOCUMENT_POST 提出的条目,但是我们收到以下错误
E RW 609 文档错误:BKPFF $ SYS600 BKPFF
E RW 632 Document BKPFF 900026 SYS600 cannot be reverse BKPFF
E RW 630 无法在组件财务会计中冲销财务会计
E F5A 9 无法冲销,参考的会计凭证。不存在 BKPFF
参考代码
Dim companyAPI As IRfcFunction = _ecc.Repository.CreateFunction("BAPI_ACC_DOCUMENT_REV_POST")
Dim rev As IRfcStructure = companyAPI.GetStructure("REVERSAL")
rev.SetValue("OBJ_TYPE", "BKPFF")
rev.SetValue("OBJ_SYS", "$")
rev.SetValue("OBJ_KEY", "900026N0342016")
rev.SetValue("OBJ_KEY_R", "900026N0342016")
rev.SetValue("COMP_CODE", "D756")
rev.SetValue("REASON_REV", "01")
Dim transfunction = _ecc.Repository.CreateFunction("BAPI_TRANSACTION_COMMIT")
transfunction.SetValue("WAIT", "X")
companyAPI.Invoke(_ecc)
transfunction.Invoke(_ecc)
Dim dt As DataTable = GetDataTableFromRFCTable(companyAPI.GetTable("RETURN"))