Error -10 while closing a Production Order with DI API
I've been trying to close some production orders using this code:
Dim oProdOrder As SAPbobsCOM.ProductionOrders
oProdOrder = Me.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductionOrders)
If oProdOrder.GetByKey(intDocEntry) Then
oProdOrder.ProductionOrderStatus = SAPbobsCOM.BoProductionOrderStatusEnum.boposClosed
If oProdOrder.Update <> 0 Then
If (0 <> intError) Then
sErrorMsg = sErrorMsg & "Production Order Close Error: " & CStr(intError) & "," & sErrMsg & _
". DocEntry: " & oProdOrder.ProductionOrderOriginEntry & vbCrLf
...But I keep getting the same error every time I try: -10,Date out of reference date range, '_SYS00000005340'
The error doesn't show when I close the Order with BO's Form. And I've checked the exchange rate for the posting and due date of the document (and also for my current date) and there seems to be no problem with it.
I'm currently working with SAP BO 2004A PL 45.
Anybody has a suggestion? a workaround?
I'll appreciate any help you can give me.
Thanks in advance...
just in case,
what is the previous state of the production order (planned, released,...)?
before you try to close the order, update the status to released:
If oProdOrder.GetByKey(newID) Then
'Cambio di stato dell'ordine da 'Planned' a 'Released'
oProdOrder.ProductionOrderStatus = boposReleased
I found this code in a DI API application written for 2004A. It was commented out so I suspect it didn't work.
'Chiusura dell 'ordine
'SelProductionOrder.ProductionOrderStatus = boposClosed
'ret = SelProductionOrder.Update
'If ret <> 0 Then
' sboCompany.GetLastError nErr, errMsg
' MsgBox "Errore " & nErr & " - " & errMsg
Hope this helps
Maybe you are looking for
Is there any way I can add a second external screen to my PBG4? I currently have a 20-inch Flat Plane Array attached to the DVI port of my G4 PowerBook, giving me effectively two screens: the PB's own and the external. Can I attach a third? I have he
Is Mac Defender a good product? It showed up on my computer and asked me to register, though it seems impossible as it asks for a serial number of the product which I don't have
For example this image: http://img12.imageshack.us/img12/1230/q4icon.png In lancelot: http://img255.imageshack.us/img255/6941/lancelot1.png In Konqueror/Dolphin: http://img694.imageshack.us/img694/448/lancelot2a.png I mean, that pink color must be tr
why do i have to close firefox from the task manager. closing the firefox window doesn't stop the program from running.
Hello community, I'm using two keyboard layouts RU and DE and switching them with Ctrl+Shift. After a recent update a third keyboard layout appeared - US. I checked /etc/X11/xorg.conf, /etc/hal/fdi/policy/10-keymap.fdi and /etc/rc.conf but in all of