SAP connector
We have been using the SAP connector for fetching the GL data and few other information like units and install base. The connectors were working fine until Oct 2023. We noticed duplicate and/or missing rows. The row counts would match. It would only have this issue when the data is in multiple packages. We had package size of 10000.
As a workaround we increased the package size 100000. But one of the integration has >500000 rows. When we tried to increase the package size to match the rows, the integration would fail with internal memory size error.
Looking into get data function, I would like to know if there is a way to add order. Below you will find the get data code. The where clause is - r3Table.AddCriteria("FISCYEAR = " & "'" & fiscalYear & "'"). Is there a way to add order by?
#Region "GetData"
'Read source data from the R3 table
Private Sub GetSourceDataSAP(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal r3Conn As R3Connection, ByVal r3TableName As String)
Try
r3Conn.LogDir = BRAPi.Utilities.GetFileShareFolder(si, FileShareFolderTypes.ApplicationOutgoing, Nothing)
r3Conn.Logging = True
r3Conn.Open()
Dim r3Table As New ReadTable(r3Conn)
Me.w_r3Table = r3Table
Dim whereclause As New Text.StringBuilder
'Set the data package size
r3Table.PackageSize = Me.m_PackageSize
r3Table.RaiseIncomingPackageEvent = True
'Specify the table to open
r3Table.TableName = r3TableName
r3table.SetCustomFunctionName("Z_XTRACT_IS_TABLE")
Dim fields As List(Of String) = GetFieldList(si, globals, api, r3conn, r3TableName)
For Each fieldname As String In fields
r3Table.Addfield(fieldname)
Next
'filters for year
' Dim fiscalYear As String = "2021"
Dim fiscalYear As String = TimeDimHelper.GetYearFromId(api.WorkflowUnitPk.TimeKey).ToString
'where clause
r3Table.AddCriteria("FISCYEAR = " & "'" & fiscalYear & "'")
'Query the table
r3Table.Run()
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Sub