on 2009 Jun 18 4:21 PM
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();
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
102 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.