Skip to Content
0
Former Member
Mar 30, 2006 at 04:00 PM

Adding a purchase order document in 2005

11 Views

Hi,

I am trying to add a purchase order via DIAPI in version 2005 and I've paste the code I had in version 2004. The purchase order is added correctly but there is a problem in the lines...

The data I introduce in the line is the same as when doing it manually, this is, ItemCode, quantity and price, but the problem is that it doesn't calculate the linetotal and neither the doctotal.

Why is this?

My code for the line data is the next :

Private Sub AddLine(ByVal ItemCode As String, ByVal Quantity As String, ByRef oPedidoLineas As Document_Lines, ByVal oCompany As SAPbobsCOM.Company, Optional ByVal Price As Double = -1)
       oPedidoLineas.ItemCode = ItemCode
        oPedidoLineas.Quantity = Quantity
        If Price = -1 Then
            oPedidoLineas.Price = SearchPrice(ItemCode, oCompany)
        Else
            oPedidoLineas.Price = Price
        End If
    End Sub

Thanks,

vane