Skip to Content

SAP Business One DI Create Blanket Agreement Error No matching records found (ODBC -2028)

My Code

In oBlanketAgreementsService.AddBlanketAgreement report an error "No matching records found (ODBC -2028)"。How to solve?

oCompany.StartTransaction()
Dim oCompanyService As SAPbobsCOM.CompanyService
Dim oBlanketAgreementsService As SAPbobsCOM.BlanketAgreementsService
Dim oBlanketAgreement As SAPbobsCOM.BlanketAgreement
oCompanyService = oCompany.GetCompanyService()
oBlanketAgreementsService = oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.BlanketAgreementsService)
oBlanketAgreement = CType(oBlanketAgreementsService.GetDataInterface(SAPbobsCOM.BlanketAgreementsServiceDataInterfaces.basBlanketAgreement), SAPbobsCOM.BlanketAgreement)
oBlanketAgreement.BPCode = "KH0007"
oBlanketAgreement.Series = -1
oBlanketAgreement.DocNum = 20190211
oBlanketAgreement.StartDate = DateTime.Now
oBlanketAgreement.SigningDate = DateTime.Now
oBlanketAgreement.EndDate = DateTime.Now
oBlanketAgreement.Description = "RSYT00011"
oBlanketAgreement.AgreementType = SAPbobsCOM.BlanketAgreementTypeEnum.atGeneral
oBlanketAgreement.AgreementMethod = SAPbobsCOM.BlanketAgreementMethodEnum.amItem
oBlanketAgreement.Status = SAPbobsCOM.BlanketAgreementStatusEnum.asApproved
Dim oBlanketAgreements_ItemsLine As SAPbobsCOM.BlanketAgreements_ItemsLine = oBlanketAgreement.BlanketAgreements_ItemsLines.Add()
oBlanketAgreements_ItemsLine.ItemNo = "CU001032"
oBlanketAgreements_ItemsLine.ItemDescription = "ZPW·J-R R2004/R2086"
oBlanketAgreements_ItemsLine.PlannedQuantity = 5
oBlanketAgreements_ItemsLine.UnitPrice = 100
oBlanketAgreementsService.AddBlanketAgreement(oBlanketAgreement)
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers