on 01-08-2015 12:04 PM
Hello Experts,
Can you help me please ! this kind of urgent.
We want to create the pick list based on Sales Order via DI API, and faced a problem. Our Sales Order contains Batch Number and then we choose the Bin location once creating the pick list without default Bin Location. So, when we create the pick list the lines are not enabled ! We think that we have to set the batch number and the Bin Location for each line in the pick list ?
In the code we created the pick list and then we updated it ( we set the bin location for each line). We tested for a document with only one line, the code works fine but when we create a document with more lines we get this error :
Error:
-10 1470000838 - Invalid "敓楲污湁䉤瑡档畎扭牥䉳獡䱥湩e"; specify a valid "敓楲污湁䉤瑡档畎扭牥䉳獡䱥湩e"
My code is attached !
Hi Malik, thanks for your replay
The inventory transfer and the pick list are not same
Can you help with script for the creation of a pick list please !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hamid,
I tried a minimal example using Demo DB but I just ended up getting the same error as you...
I created an Order with 2 lines :
After a lot of trying ( I never actually had a real life case with batch and bin ) I came up with the following working code
SAPbobsCOM.Documents oOrder = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
SAPbobsCOM.PickLists oPickList = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists);
int docEntry = 381;
oOrder.GetByKey(docEntry);
for (int i = 0; i < oOrder.Lines.Count; i++)
{
if (i > 0)
oPickList.Lines.Add();
oOrder.Lines.SetCurrentLine(i);
oPickList.Lines.SetCurrentLine(i);
oPickList.Lines.OrderRowID = i;
oPickList.Lines.BaseObjectType = "17";
oPickList.Lines.OrderEntry = docEntry;
oPickList.Lines.ReleasedQuantity = oOrder.Lines.Quantity;
}
if (oPickList.Add() != 0)
MessageBox.Show(SBO_Company.GetLastErrorDescription());
else
{
String PickAbs = SBO_Company.GetNewObjectKey();
oPickList.GetByKey(Convert.ToInt32(PickAbs));
for (int i = 0; i < oPickList.Lines.Count; i++)
{
oPickList.Lines.SetCurrentLine(i);
oPickList.Lines.PickedQuantity = oPickList.Lines.ReleasedQuantity;
oPickList.Lines.BatchNumbers.BatchNumber = "B1-00097";
oPickList.Lines.BatchNumbers.Quantity = oPickList.Lines.PickedQuantity;
oPickList.Lines.BinAllocations.BinAbsEntry = 10;
oPickList.Lines.BinAllocations.Quantity = oPickList.Lines.PickedQuantity;
oPickList.Lines.BinAllocations.BaseLineNumber = i;//This was the key, if you just handl bins it is automatically set
oPickList.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
}
if (oPickList.Update() != 0)
MessageBox.Show(SBO_Company.GetLastErrorDescription());
else
MessageBox.Show("Success");
}
regards,
Maik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
9 | |
9 | |
5 | |
4 | |
4 | |
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.