Skip to Content
0

Progress Bar - has stopped [66000-88]

Jul 14, 2017 at 10:23 AM

109

avatar image
Former Member
	oProgress = gUI.StatusBar.CreateProgressBar("Importing " & sFolders(sFolders.Length - 1) & " File.Please Wait ...", dtTable.Rows.Count, False)
		iExcelRow = 0
		Dim withError As Boolean = False
		For i As Integer = 1 To dtTable.Rows.Count - 1
			If dtTable.Rows(i)(0).ToString <> "" Then
				createLocalCommission(dtTable.Rows(i), sAccountCode, sGenCode)
				iExcelRow = iExcelRow + 1
				Try
					oProgress.Value = iExcelRow
					oProgress.Text = "Importing " & sFile & " File. Line (" & i & " of " & dtTable.Rows.Count & ") Please Wait ..."
				Catch ex As Exception
					Try
retry:
						System.Runtime.InteropServices.Marshal.ReleaseComObject(oProgress)
						oProgress = Nothing
						oProgress = gUI.StatusBar.CreateProgressBar("Importing " & sFolders(sFolders.Length - 1) & " File.Please Wait ...", iDivide, False)
						oProgress.Value = iExcelRow
						oProgress.Text = "Importing " & sFile & " File. Line (" & i & " of " & dtTable.Rows.Count & ") Please Wait ..."
					Catch e As Exception
						GoTo retry
					End Try
				End Try
			End If
		Next
Private Sub createLocalCommission(ByVal data As DataRow, ByVal sAccountCode As String, ByVal sGenCode As String)
        Try
            Dim RetVal As Long
            'Create the Documents object
            Dim gAP As SAPbobsCOM.Documents
            Dim sDocEntry As String = ""
            gAP = gDI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices)
            gAP.CardCode = data(LocalCommission.SponsorID).ToString
            gAP.CardName = data(LocalCommission.SponsorName).ToString
            gAP.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service
            gAP.DocDate = Date.Today 'Data(RegularCommission.DateOfPurchase)
            gAP.Comments = data(LocalCommission.Remarks).ToString
            gAP.ControlAccount = sLocalControlAccount
            gAP.UserFields.Fields.Item("U_TRANSID").Value = data(LocalCommission.id).ToString
            gAP.Lines.LineTotal = data(LocalCommission.TotalAmount)
            gAP.Lines.AccountCode = sAccountCode
            gAP.Lines.VatGroup = sLocalVatCode
            If data(LocalCommission.WT10) Is DBNull.Value = False Then
                gAP.WithholdingTaxData.WTAmount = data(LocalCommission.WT10)
                gAP.WithholdingTaxData.WTCode = sLocalWT10
                gAP.WithholdingTaxData.Add()
            End If


            If data(LocalCommission.WT12) Is DBNull.Value = False Then
                gAP.WithholdingTaxData.WTAmount = data(LocalCommission.WT12)
                gAP.WithholdingTaxData.WTCode = sLocalWT12
                gAP.WithholdingTaxData.Add()
            End If


            If data(LocalCommission.WT3) Is DBNull.Value = False Then
                gAP.WithholdingTaxData.WTAmount = data(LocalCommission.WT3)
                gAP.WithholdingTaxData.WTCode = sLocalWT3
                gAP.WithholdingTaxData.Add()
            End If


            'Add the Invoice
            RetVal = gAP.Add
            'Check the result
            If RetVal <> 0 Then
                insertImportLog("", "18", "Error", gDI.GetLastErrorDescription, sGenCode, data(LocalCommission.id))
            Else
                gDI.GetNewObjectCode(sDocEntry)
                insertImportLog(sDocEntry, "18", "Success", "", sGenCode, data(LocalCommission.id))
            End If
            clearObject(gAP)
        Catch ex As Exception
            'gUI.MessageBox("CREATELOCALCOMMISSION ERROR = " & ex.ToString)
            insertImportLog("", "18", "Error", ex.ToString, sGenCode, data(LocalCommission.id))
        End Try
    End Sub
    Private Sub insertImportLog(ByVal sDocEntry As String, ByVal sObjType As String, ByVal sStatus As String, ByVal sDescription As String, ByVal sGenCode As String, ByVal sTransID As String)
        Try
retry:


            Dim RetVal As Long
            oUserTable = gDI.UserTables.Item("IMPORTLOG")
            'oUserTable.Code = GenerateRandomString(50)
            oUserTable.Name = GenerateRandomString(50)
            oUserTable.UserFields.Fields.Item("U_DOCENTRY").Value = sDocEntry
            oUserTable.UserFields.Fields.Item("U_OBJECTTYPE").Value = sObjType
            oUserTable.UserFields.Fields.Item("U_CREATEDATE").Value = Date.Today
            oUserTable.UserFields.Fields.Item("U_USERID").Value = gDI.UserSignature.ToString
            oUserTable.UserFields.Fields.Item("U_STATUS").Value = sStatus
            oUserTable.UserFields.Fields.Item("U_DESCRIPTION").Value = sDescription
            oUserTable.UserFields.Fields.Item("U_FOLDER").Value = sFolder
            oUserTable.UserFields.Fields.Item("U_FILE").Value = sFile
            oUserTable.UserFields.Fields.Item("U_EXCELROW").Value = iExcelRow
            oUserTable.UserFields.Fields.Item("U_GENCODE").Value = sGenCode
            oUserTable.UserFields.Fields.Item("U_TRANSID").Value = sTransID
            RetVal = oUserTable.Add()
            If RetVal <> 0 Then
                'gUI.MessageBox("INSERTIMPOTLOG ERROR  = " & gDI.GetLastErrorDescription())
                Logger("ERROR", "INSERTIMPORTLOG", "ERROR = " & gDI.GetLastErrorDescription())
                Logger("ERROR", "INSERTIMPORTLOG", "GOING TO RETRY")
                GoTo retry
            End If
        Catch ex As Exception
            'gUI.MessageBox("INSERTIMPORTLOG ERROR = " & ex.ToString)
            Logger("ERROR", "INSERTIMPORTLOG", "ERROR = " & ex.ToString)
            Logger("ERROR", "INSERTIMPORTLOG", "GOING TO RETRY")
            GoTo retry
        End Try
    End Sub


I am having error on the set value part, this is the error
System.Runtime.InteropServices.COMException (0xFFFFE37B): Progress Bar - has stopped  [66000-88]
   at SAPbouiCOM.ProgressBarClass.set_Value(Int32 pVal)
The number of transaction that I am trying to load is 6k	
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers