UDO with DI object - some times udo data gets added but not di obj data

Dear Experts,
  Greetings.
   I have created a customized inventory transfer form according to the customer need. I have used document type udo object and inventory transfer. Some times the udo data gets added without adding the data through inventory transfer object. Below is the code that i am using in the item event,
If pVal.ItemUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.Before_Action = True _
                    And pVal.FormMode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
                    Try
                        If DeliveryChallanValidate(oForm) = False Then
                            If DC_company.InTransaction Then
                                DC_company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                            End If
                            BubbleEvent = False
                            Exit Sub
                        Else
                            Try
                                DC_company.StartTransaction()
                               'Inventorytransfer function is used to add the inventory transfer data through DI 'object.Returns
         ' true if sucessfully added and false if there is any error.
                                If InventoryTransfer(oForm) = True Then
                                        If DC_company.InTransaction Then
                                            DC_company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
                                        End If
                                        BubbleEvent = True
                                        Exit Sub
                                Else
                                    If DC_company.InTransaction Then
                                        DC_company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                                    End If
                                    BubbleEvent = False
                                    Exit Sub
                                End If
                            Catch ex As Exception
                                If DC_company.InTransaction Then
                                    DC_company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                                End If
                                BubbleEvent = False
                                DC_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                            End Try
                        End If
                    Catch ex As Exception
                        If DC_company.InTransaction Then
                            DC_company.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                        End If
                        BubbleEvent = False
                        DC_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                        Exit Sub
                    End Try
                End If
I Would like to know if there is any other method by which if there is any error the UDO data or DI object then both should not add. I am working in SBO 2007B Patch 17.
Regards,
Gokul K.

Dear Siva,
  Thanks for your response. I did go through the links that you have posted. I do not have any problem in adding the stock transfer through DIAPI. My problem is that if the addon that i have developed gets disconnected, what happens is like only the udo data from the user defined form gets added and the stock transfer does not work. Hope i made my point clear.
Regards,
Gokul K.

Similar Messages

Maybe you are looking for