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

Updating SAP Document - Doesn't Update Line Totals

I have created a Purchase Order using the DI API. I have a single line item where I am setting the item code, description, currency, rate, quantity and price. When I save this document initially (Add), the line total and document total are updated automatically.

When I go back to this document using the DI API and add a new line item (Update) and again set the item code, description, currency, rate, quantity and price, the line total is not updated automatically and therefore the document total is incorrect as well.

Am I missing a step here? I have resolved to set my line total manually for now but don't really feel I should have to do this.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Feb 17, 2005 at 08:10 AM

    Hi David,

    I have tried to reproduce your problem.

    If I modify the document and go to B1 and visualize the Document, the DocTotal visualized in the screen is correct.

    But if just after "document.Update" I ask for "document.DocTotal" the value into DocTotal is the old one (doesn't take into account the new added line).

    I have a workaround who solves it, but I think you should ask support for a better way.

    My work around is to ask for the document one more time using for example the GetByKey.

    Here you have my code with the workaround:

    document = pCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)

    ' I take one of my documents already created

    If document.GetByKey(41) Then

    document.Lines.Add()

    document.Lines.ItemCode = "A00002"

    document.Lines.Quantity = 2

    document.Lines.Price = 50

    iResult = document.Update

    Dim total, total2 As Double

    total = document.DocTotal ' Old value not updated

    document.GetByKey(41)

    total2 = document.DocTotal() ' Total with new value

    End If

    Hope it helps

    Trinidad.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 01:33 PM

    I had this problem and logged a test case with support (Sales Orders in my case, but probably applies to all marketing documents). I received the fix last week in patch 11. This patch isn't on the general download pages yet, I got it direct from support.

    I would suggest you contact support and request the patch.

    Regards,

    John.

    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.