on 04-25-2011 8:14 PM
Hi,
In the object oDeliveryNotes, the fields PickListIdNumber is readonly. I know the the PickList is not a markething document, but is there a way, using the DI to specify wich Picklist to use as a reference
Example:
Order #1 Got Item A, Qty 5
PickList #1 From Order #1, Item A, Qty 1
PickList #2 From Order #1, Item A, Qty 1
If i go in the UI, in the PickList #1 and say copy to DeliveryNotes, All is OK.
If i create a DeliveryNotes For Order #1, Item A, Qty 1, Both Pick list will be closed. But i would like to close only The Picklist #1 or #2
Hi Mario,
What you need to do is read the picklist tables to see which sales order lines are linked to the pick list you want and then use the BaseEntry, BaseType and BaseLine properties in the delivery lines to create deliveries for the sales orders.
The following query will give you the list or sales orders linked to a paritcular pick list:
select distinct(OrderEntry) from PKL1 where AbsEntry = xx and BaseObject = 17 order by OrderEntry
You can then create a new delivery using the DI API for each sales order in this list and add lines to the delivery for just the lines and quantities that are on the pick list:
select OrderEntry, OrderLine, RelQtty from PKL1 where AbsEntry = xx and BaseObject = 17 and OrderEntry = yy
For each line on the delivery, the BaseType would be 17, the BaseEntry would be the OrderEntry value returned from the query above, the BaseLine would be the OrderLine and the Quantity would be the RelQtty from the query.
Kind Regards,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Owen,
That will help me to know wich line of the order to use to create my delivery, but wont fix the issue that is i have another pick for the same line of the order, but pick line will be closed. Here's a little simplify snippet of what i am using to reproduce the issue.
In this code, i am creating a new order ( sOrderEntry ) Creating 2 differents pick ticket ( sPickEntry1 and sPickEntry2 ) then, i open back the first pick to confirm the pick qty and then i create a delivery note ( sDeliveryEntry ) When i go back into SAP, the Pick 1 and 2 are now closed even if i have said to deliver a qty of 1. I dont see any way of specifying wich Pick to deliver so SAP wont close the other one.
oOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
oOrder.CardCode = "C00001"
oOrder.DocDate = Now()
oOrder.DocDueDate = Now()
oOrder.Lines.ItemCode = "A00001"
oOrder.Lines.Quantity = 3
iERR = oOrder.Add()
If iERR <> 0 Then
oCompany.GetLastError(iERR, sMsg)
Exit Try
End If
sOrderEntry = oCompany.GetNewObjectKey()
For x = 1 To 2
oPick = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists)
oPick.PickDate = Now()
oPick.OwnerCode = 1
oPick.Name = "TEST"
oPick.Remarks = "TEST"
oPick.Lines.SetCurrentLine(0)
oPick.Lines.OrderEntry = sOrderEntry
oPick.Lines.OrderRowID = 0
oPick.Lines.ReleasedQuantity = 1
oPick.Lines.BaseObjectType = SAPbobsCOM.BoObjectTypes.oOrders
iERR = oPick.Add
If iERR <> 0 Then
oCompany.GetLastError(iERR, sMsg)
Exit Try
End If
If x = 1 Then sPickEntry1 = oCompany.GetNewObjectKey()
If x = 2 Then sPickEntry2 = oCompany.GetNewObjectKey()
Next
oPick = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists)
oPick.GetByKey(sPickEntry1)
oPick.Lines.SetCurrentLine(0)
oPick.Lines.PickedQuantity = 1
oPick.Update()
oDelivery = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
oDelivery.CardCode = "C00001"
oDelivery.DocDate = Now()
oDelivery.DocDueDate = Now()
oDelivery.Lines.ItemCode = "A00001"
oDelivery.Lines.Quantity = 1
oDelivery.Lines.BaseEntry = sOrderEntry
oDelivery.Lines.BaseLine = 0
oDelivery.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
iERR = oDelivery.Add()
If iERR <> 0 Then
oCompany.GetLastError(iERR, sMsg)
Exit Try
End If
sDeliveryEntry = oCompany.GetNewObjectKey()
Hi Mario,
You could simply try to rethink your approach.
As I understand it, you create an order then several pick lists that someone in the warehouse uses to pick the order, and then create as many deliveries as there are pick lists.
You can use Owen's method and check the line status from the order instead of from the pick list object. In other words, use the pick list only for information purposes, and handle everything else directly between the order and delivery documents.
Otherwise, as your requirement sounds somewhat unconventional, you might have to look into a third-party solution or build your own pick / pack app altogether (as we did for our warehouse).
Good luck,
Johan
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
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.