cancel
Showing results for 
Search instead for 
Did you mean: 

Incoming Payments and Payments Means via DI API

Former Member
0 Kudos

Hi everyone

I want to apply Incoming Payment on account via DI API and C#, but i get the next error

-5002 Amount to be paid does not match existing transactions

The question is how can I acces to the Payments Means via DI API?

This is my code:

SAPbobsCOM.Payments oPmt;

oPmt = ((SAPbobsCOM.Payments)(oCompany.GetBusinessObject SAPbobsCOM.BoObjectTypes.oIncomingPayments)));

oPmt.DocDate = DateTime.Now;

oPmt.DocTypte = SAPbobsCOM.BoRcptTypes.rAccount;

oPmt.AccountPayments.AccountCode = "_SYS00000000026";

oPmt.AccountPayments.SumPaid = 100;

oPmt.AccountPayments.Add();

lRetCode = oPmt.Add();

if (lRetCode != 0)

{

oCompany.GetLastError(out lErrCode, out sErrMsg);

Console.Write(lErrCode + " " + sErrMsg); // Display error message

}

else

{

Console.Write("Payment aplied");

}

Thank's

David

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I fix the problem

Thanks

Former Member
0 Kudos

Hello David,

Could you please share how did you fix the problem?

Thanks!