on 11-17-2014 10:52 AM
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 :
ItemCode | Qty | Bin Code |
Item001 | 800 | WHS001-COL01-LVL2 |
Item001 | 500 | WHS001-COL01-LVL3 |
Item001 | 300 | WHS001-COL01-LVL4 |
Item002 | 800 | WHS001-COL02-LVL2 |
Item002 | 500 | WHS001-COL02-LVL3 |
Item002 | 300 | WHS001-COL02-LVL4 |
After change Bin Allocation :
ItemCode | Qty | Bin Code |
Item001 | 1600 | WHS001-COL01-LVL1 |
Item002 | 1600 | WHS001-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
Hi
Have you a solution for it?
Thanks,
Marcelo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.