Skip to Content
0
Former Member
Jan 04, 2006 at 06:53 PM

Error in .NET Compiler when Adding BudgetDistribution

27 Views

Hi,

I am using SAP 2004 and trying to add budgetdistribution through DI APIs. However, I got the error "Property, indexer, or event 'BudgetAmount' is not supported by the language; try directly calling accessor methods 'SAPbobsCOM.IBudgetDistribution.get_BudgetAmount()' or 'SAPbobsCOM.IBudgetDistribution.set_BudgetAmount(string)'" on assigning BudgetAmount.

Below is my code in C#:

SAPbobsCOM.BudgetDistribution vBGD = (SAPbobsCOM.BudgetDistribution)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBudgetDistribution);

vBGD.Description = "Equal";

vBGD.BudgetAmount = 12;

vBGD.January= 1;

vBGD.February = 1;

vBGD.March =1;

...

int retVal = vBGD.Add();

int errCode;

string errMsg;

if (0 != retVal){

conn.InternalConnection.GetLastError(out errCode, out errMsg);

Console.WriteLine(string.Format("Error code: {0} /r/n Error Message: ",errCode, errMsg));

}else {

Console.WriteLine("Successfully add budget distribution");

}

I would appreciate if anyone can help me with this problem.

Sunny