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

Help! Order-line whse update NOT changing item/whse "committed" quantities

<u><b>Help</b></u> - I've run out of ideas. It seems the order-line whse update is NOT changing item/whse "committed" quantities. (This is SBO 2005A SP01 PL29.)

The SDK program changes the warehouse code on order lines. The lines are being changed correctly, but the "committed" quantities in the affected warehouses are not being updated. I assume this would be done automatically when I update an order through the SDK, just as it is when I update the order manually through the screens. For example, if I change an order line quantity of 10 from warehouse X to warehouse Y, shouldn't the committed quantity decrease by 10 in warehouse X and increase by 10 in warehouse Y?

Below is the (simple) routine that actually does the update. The parameters are docEntry (the order to be updated) and Whse (the new warehouse for all the order lines in the order). Is there anything missing/incorrect?

--------------------------------------------------------------------------------
Private Sub UpdateOrder(ByVal docEntry As Integer, ByVal Whse As String)
   Dim pOrder As SAPbobsCOM.Documents
   Dim OrigWhse As String, WhseOk As Boolean
   Dim i As Integer, rc As Integer, errMsg As String = ""
 
   pOrder = Cmp.GetBusinessObject(oOrders)
   If pOrder.GetByKey(docEntry) = False Then
       Log(String.Format("Order not found, DocEntry={0}", docEntry))
       Return
   End If
        With pOrder.Lines
            For i = 0 To .Count - 1
                .SetCurrentLine(i)
                OrigWhse = .WarehouseCode
                Log("      " & _
                    "Line=" & .LineNum + 1 & _
                    ", Item=" & .ItemCode & " (" & .ItemDescription & ")" & _
                    ", Qty=" & String.Format(.Quantity, "###,##9") & _
                    ", Whse from=" & OrigWhse & _
                    " to=" & Whse)
                WhseOk = ItemWhse(.ItemCode, Whse) 
              ' Verify item valid in target whse
                If WhseOk = True Then
                    If Whse <> OrigWhse Then
                        .WarehouseCode = Whse                   ' Update the line WHSE 
                    End If
                Else
                    Log("         " & _
                        "*** Item <" & .ItemCode & "> not defined in whse <" & Whse & ">")
                End If
            Next i
        End With
        pOrder.DocumentsOwner = Nobody                          ' Set the OWNER to NOBODY
        pOrder.UserFields.Fields.Item("U_Whse").Value = Whse    ' Set the default whse in the order
        rc = pOrder.Update()                                    ' Update the order 
        pOrder.
        If (rc <> 0) Then
            Cmp.GetLastError(rc, errMsg)
            Log("Order update error, code=" + Str(rc) + ", msg=" + errMsg)
        End If
    End Sub

Below is the log output of the program, which suggests that everything is being processed ok.

9/10/2007 10:22:00 AM: ================================================================================

9/10/2007 10:22:00 AM: ICI-WebOrders start

9/10/2007 10:22:03 AM: Database <Live> opened

9/10/2007 10:22:38 AM: Order=52014, Owner=3, PRX_SID=15, PRX_SRVR=XXXX, Cust=60401 (Cust 60401), Lines=1, DefWhs=0T

9/10/2007 10:23:25 AM: Line=1, Item=CH408 (STP 408 Gran. LD Food Grade 50#), Qty=10, Whse from=0S to=0T

9/10/2007 10:39:34 AM: ICI-WebOrders end

After the update, the order lines have been updated properly. However, the

"committed" quantity in warehouse 0S is 10 before and after the run, and the committed quantity in warehouse 0T is 0 before and after.

Any help would be <u>greatly</u> appreciated.

Dave

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Sep 10, 2007 at 07:21 PM

    David,

    Is the only thing that gets changed on this order is the warehouse the inventory is coming out of? The code below shows this, but I am wondering of the Delivery Date changes? There was an issue corrected with 2005A SP01 PL32 where the Qty Committed was not updated correctly on an Order when the Delivery Date changed. You may want to download PL32 and test against this issue.

    Also, see this note on PL32 ... https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/706969ee-a13e-2a10-bd9f-c91e128ec0d2 [original link is broken]

    Eddy

    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.