cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to change/remove Bin Allocation BinAbsEntry in PickList Object through DI API?

Former Member
0 Kudos

Hi All Gurus,

I have a problem with SDK DI API for SAP 9.0 PL 11.

This is the scenario:

1. I create Pick List document through SAP Screen (Inventory - Pick Pack Manager), with 3 items from Open Sales Order document.

     2 of 3 items are managed by batch for every transaction, one of them is using UoM Group, and the other using 'Manual' UoM Group.

     I setup so that 1 warehouse using Bin Location (Enabled Bin Location), let's say Warehouse Code WHS001, and Sales Order use this warehouse for issueing items.

     I use 'Release to Pick List' button in Pick And Pack Manager to create picklist, and while at it, somehow a wizard popped up to select bin location dimension to be allocated.

2. I want to create a code in my addon, to change allocated Bin Location Code from Bin A, Bin B, Bin C to Bin E in WHS001, but the total quantity is the same. For example :


     Before change Bin Allocation :

   

ItemCodeQtyBin Code
Item001800WHS001-COL01-LVL2
Item001500WHS001-COL01-LVL3
Item001300WHS001-COL01-LVL4
Item002800WHS001-COL02-LVL2
Item002500WHS001-COL02-LVL3
Item002300WHS001-COL02-LVL4



     After change Bin Allocation :

ItemCodeQtyBin Code
Item0011600WHS001-COL01-LVL1
Item0021600WHS001-COL02-LVL1



This is my code :


Private Sub ReAllocateBinLoc(ByVal oForm As SAPbouiCOM.Form)

        Dim oPL As SAPbobsCOM.PickLists

        Dim oPLLine As SAPbobsCOM.PickLists_Lines

        Dim oPLBin As SAPbobsCOM.DocumentLinesBinAllocations

        Dim ListPLEntry As New List(Of Integer)

        Try

            oCompany.StartTransaction()

            oPL = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists)

            oPL.GetReleasedAllocation(44758)

            oPLLine = oPL.Lines

            For ix As Integer = 0 To oPLLine.Count - 1

                oPLLine.SetCurrentLine(ix)

                oPLLine.ReleasedQuantity = 1600

                oPLBin = oPLLine.BinAllocations

                For idx As Integer = 0 To oPLBin.Count - 1

                    oPLBin.SetCurrentLine(idx)

                    If idx = 0 Then

                        oPLBin.BinAbsEntry = 3

                        oPLBin.Quantity = 1600

                    Else

                        ''What should I do with the other allocated bin?

                        ''Can I just set them to zero quantity

                        'oPLBin.BinAbsEntry = -1

                        'oPLBin.Quantity = 0

                    End If

                Next

            Next

            Dim retval As Integer = oPL.UpdateReleasedAllocation()

            Debug.WriteLine("RETVAL = " & retval)

            If retval <> 0 Then

                Throw New Exception(oCompany.GetLastErrorDescription)

            End If

            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)

        Catch ex As Exception

            Debug.WriteLine(ex.Message)

            Debug.WriteLine(ex.StackTrace)

            SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)

        End Try

    End Sub


But i got an error :

1470000341 - Fully allocate item "Item001" to bin locations in warehouse "WHS001"


Please help if someone have an answer, I already tried to change my code in last 3 days, but still error.


Thanks,

Kind Regards,

Siddharta

    



Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Have you a solution for it?

Thanks,

Marcelo