Skip to Content
author's profile photo Former Member
Former Member

passing double values via c#

I am trying to make a purchaseorder via the sdk with

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, 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
    //... wrote order to database

thanks for any help

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 21, 2005 at 02:16 PM

    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.


    Ibai Peñ

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.