on 01-21-2005 12:57 PM
I am trying to make a purchaseorder via the sdk with c#.net.
Everything works fine but when i try to pass a quantity or a price as a double (eg 2.34) i lose the digits behind the comma.(i tried the same in vb.net, there it works but i'd prefer c#.)
Here is the code:
SAPbobsCOM.Documents oOrder = (SAPbobsCOM.Documents)oCompany.GetBusinessObject SAPbobsCOM.BoObjectTypes.oPurchaseOrders);
oOrder.DocObjectCode = SAPCOM.BoObjectTypes.oPurchaseOrders;
oOrder.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO;
oOrder.DocDate = System.DateTime.Now;
oOrder.DocDueDate = System.DateTime.Now;
oOrder.CardCode = "30005";
oOrder.Lines.ItemCode = "581330g";
oOrder.Lines.ItemDescription = "abcd";
oOrder.Lines.Quantity = 1.5
oOrder.Lines.Price = 2.34;
int iRetCode = oOrder.Add();
if (iRetCode != 0)
{
//... errors
}
else
{
//... wrote order to database
}
thanks for any help
Hi franz,
Which separator have you got defined in the general settings?
If it is "," SBO will not understand your number as a double.
You could try to pass the values as strings with "," separator instead of an double. I suppose SBO will parse it.
Regards,
Ibai Peñ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.