Using BAPI_ACC_DOCUMENT_REV_POST
to reverse entries posed via BAPI_ACC_DOCUMENT_POST
, however we are getting following errors
E RW 609 Error in document: BKPFF $ SYS600 BKPFF
E RW 632 Document BKPFF 900026 SYS600 cannot be reversed BKPFF
E RW 630 Reversal in component Financial Accounting not possible Financial Accounting
E F5A 009 Reversal not possible, accounting document for the ref. does not exist BKPFF
code for reference
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"))