Skip to Content
0
Nov 26, 2022 at 03:06 PM

Add Outgoing Payment Draft for A/P Invoice through DI API

270 Views

I need to create Outgoing Payment Draft for the A/P Invoice. i am getting the following error...help me to resolve this..." Invalid document number [VPM2.DocEntry][line: 1] "

My Code is here...

SAPbobsCOM.Payments oPayment;

oPayment = Global.oCompany.GetBusinessObject(BoObjectTypes.oPaymentsDrafts);

oPayment.DocObjectCode = BoPaymentsObjectType.bopot_OutgoingPayments;

oPayment.DocType = BoRcptTypes.rSupplier;

oPayment.CardCode = CardCode;

oPayment.BPLID = Branch;

oPayment.Invoices.DocEntry = Convert.ToInt32(ApInvoiceNo);

oPayment.Invoices.Add();

//Bank Transfer

oPayment.TransferSum = Amount;

oPayment.TransferAccount = AcctCode;

oPayment.TransferDate = DateTime.Now;

int add=oPayment.Add();