cancel
Showing results for 
Search instead for 
Did you mean: 

Payment Bank Transfer - Account for bank transfer has not been defined

Former Member
0 Kudos
804

Hi,

I am doing a Bank Transfer in my SDK development and I get following error:

"Account for bank transfer has not been defined "

I use _SYS00000000002 (Cash at Bank - Checking (HO, USA, GA )) from the US demo database for testing and it doesn't work.

My code is below.

Thank you,

Rune

oPayments = (SAPbobsCOM.Payments)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);
 
                    oPayments.CardCode = vmp_CardCode_string;
                    oPayments.DocDate = DateTime.Now;
                    oPayments.JournalRemarks = "Incoming - Payment Bank Transfer";
                    oPayments.TaxDate = DateTime.Now;
                    
                    SAPbobsCOM.Recordset oRecordset_BankAccount = null;
                    oRecordset_BankAccount = ((SAPbobsCOM.Recordset)(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));
                    oRecordset_BankAccount.DoQuery("SELECT * FROM [dbo].[@PAY_TYPE] WHERE [U_PayMethod] = '01'");
                    oRecordset_BankAccount.MoveFirst();
                    if (oRecordset_BankAccount.EoF == true) // No Records
                    {
                    }
                    else
                    {
                        vmp_BankAccount_string = Convert.ToString(oRecordset_BankAccount.Fields.Item("U_BankAccount").Value);
                    }
 
                    oPayments.TransferAccount = vmp_BankAccount_string;// "_SYS00000000343"; //"1010140-001";
                    oPayments.TransferDate = DateTime.Now;
                    oPayments.TransferReference = vmp_CardCode_string;
                    oPayments.TransferSum = vmp_Amount_double;
 
                    vc_Message_Result_Int32 = oPayments.Add();

Accepted Solutions (1)

Accepted Solutions (1)

former_member201110
Active Contributor
0 Kudos

Hi Rune,

I'm not sure what's wrong as it works fine for me. You should only need to set the TransferAccount and TransferSum values. A simplified version (using hardcoded values from my test database) would be:


SAPbobsCOM.Payments sboPay = (SAPbobsCOM.Payments)_sboCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments);

sboPay.CardCode = "100001";
sboPay.TransferAccount = "_SYS00000000005";
sboPay.TransferSum = 1234.56;

if (sboPay.Add() != 0) _sboApp.SetStatusBarMessage("Error: " + _sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);

Try a simplified version of your code in case the error message you receive is misleading.

Kind Regards,

Owen

Former Member
0 Kudos

Hi Owen,

_SYS00000000005 works fine (Cash at Bank - Credit Card (HO, USA, GA ))

_SYS00000000002 does not work (Cash at Bank - Checking (HO, USA, GA ))

Only 3 number wrong...

I have made the account number dynamic so the consultant can find the right account number at the customer...the test is done!

Thank you very much,

Rune

Answers (0)