on 05-27-2016 6:56 PM
I've checked the SDK Help and while the Deposit object has a Checks and a Credits property (Deposit.Checks and Deposit.Credits) which are of type CheckLine and CreditLine respectively have all their properties defined as read only. I want to do something like this but I can't (pseudocoded)
Deposit.Checks.Add()
Deposit.Checks.Item(1).AccountNumber = "ABC123"
Nor can I do this
CheckLine MyCheckLine;
MyCheckLine.AccountNumber = "ABC123"
I get a syntax error stating that the property is read only in both cases.
Is it possible to create deposits of checks and credit cards and my understanding of how it works is wrong
Or the SDK does not allow this kind of deposits to be created?
Hi Hector,
For you to do a deposit with credit card or check, you need to have an check or a credit card to compesating.
For check, you can look in OCHH table, where the checks with the column deposited equals 'N'
SELECT CheckKey FROM OCHH WHERE Deposited = 'N'
In the deposit object, you only defines the checkKey property, with the value that you catch in the SQL statement.
For credit card, you should do the same thing, but you need do a sql in OCRH.
SELECT AbsId FROM OCRH WHERE Deposited = 'N'
In the deposit object, you only defines the AbsId property, with the value that you catch in the SQL statement
Hope it helps.
Best regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Diego.
I tried what you mentioned doing something like this:
MyDeposit.Check.Add();
MyDeposit.Check.Item(0).CheckKey = 1;
The number 1 is in fact a check where the Deposited property is == 'N'
I've specified the MyDeposit.BankAccount and I get the error "Missing bank account"
So I specified the MyDeposit.DepositAccount too and I get the error "Missing allocation account"
I then specified the MyDeposit.AllocationAccount and I now get the (loosely translated) error "Cash amount must be positive"
When I debug my code, right before adding the deposit, I check for the MyDeposit.Checks.Item(0).CheckAmount and the value is 0. No values are retrieved for the check so I suppose that (in theory) the Check values are retrieved during the insertion operation.
In conclusion, it is not working... but I don't know why. What am I doing wrong? 😕
Hi Hector,
My sample code for check deposits:
SAPbobsCOM.CompanyService oCompanyService = oCompany.GetCompanyService();
//Create the deposit
SAPbobsCOM.DepositsService oDepositService = (SAPbobsCOM.DepositsService)oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.DepositsService);
SAPbobsCOM.Deposit oDeposit = (SAPbobsCOM.Deposit)oDepositService.GetDataInterface(SAPbobsCOM.DepositsServiceDataInterfaces.dsDeposit);
SAPbobsCOM.DepositParams oDepositParams = (SAPbobsCOM.DepositParams)oDepositService.GetDataInterface(SAPbobsCOM.DepositsServiceDataInterfaces.dsDepositParams);// = dpService.AddDeposit(dpsAddCash);
oDeposit.DepositType = SAPbobsCOM.BoDepositTypeEnum.dtChecks;
CheckLines chks = oDeposit.Checks;
CheckLine chk = chks.Add();
chk.CheckKey = 9;
Console.WriteLine(chk.CheckAmount);
oDeposit.DepositDate = DateTime.Today;
oDeposit.DepositCurrency = "R$";
oDeposit.DepositAccount = "1.01.01.02.02";
oDepositParams = oDepositService.AddDeposit(oDeposit);
Console.WriteLine(oDepositParams.DepositNumber);
About the check amount, you are correct, the api only fill it in the insert operation.
My SAP is 9.1 PL 11.
Hope it helps.
Best regards,
Diego Lother
You can try this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.