cancel
Showing results for 
Search instead for 
Did you mean: 

Create PickList with Batch number and Bin Allocation

Former Member
0 Kudos

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 !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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 !

maik_delly
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Delly,

Thank's a lot, it was a very helpful for our project.

a little question, can we use the automatic bin allocation according the standard settings ( LIFO, FIFO, ...).

maik_delly
Active Contributor
0 Kudos

Hi Hamid,

I really don't know, but if it is working then you just have to leave out the allocation of bins.

regards,

Maik

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Maik,  How are you ?

Can you help me to know how I can  put a variable for "oNotaEntrega.Lines.BinAllocations.BinAbsEntry".

On this example assigned  a fixed value, but reality it can be any value from table OIBQ

Please, please  help me

maik_delly
Active Contributor
0 Kudos

Hi Hamid,

have a look at

or

regards,

Maik