This commit is contained in:
2024-05-06 13:38:52 +02:00
parent 8a9bdc2fcd
commit ae4032ea59
39 changed files with 8034 additions and 9053 deletions

View File

@@ -5,7 +5,7 @@ Public Class ClassSAP
Public Shared SAPConnectionString
Public Shared SAP_CONNECTION As New R3Connection()
Private Shared NewDatatable As DataTable
Private Shared _NewDatatable As DataTable
Public Shared Function ConnectionInit(Host As String, SysNumber As String, Username As String, PW As String, Client As String, Lang As String)
Try
LOGGER.Debug("")
@@ -139,32 +139,32 @@ Public Class ClassSAP
Try
LOGGER.Debug("Processing data package with " +
PackageResult.Rows.Count.ToString() + " rows")
If NewDatatable Is Nothing Then
NewDatatable = PackageResult.Clone
If _NewDatatable Is Nothing Then
_NewDatatable = PackageResult.Clone
LOGGER.Debug("...NewDatatable initialized!")
End If
NewDatatable.Merge(PackageResult, False)
_NewDatatable.Merge(PackageResult, False)
LOGGER.Debug("...Datatable merged with PackageResult!")
Catch ex As Exception
MsgBox(ex.Message)
LOGGER.Error(ex)
End Try
End Sub
Public Shared Function Return_Datatable_for_Table(tablename As String, where_clause As String, oRaisIncomPack As Boolean, RowLimit As Integer)
Public Shared Function Return_Datatable_for_Table(pTablename As String, pWhere_clause As String, pRaisIncomPack As Boolean, RowLimit As Integer)
Try
Dim RESULT_TABLE As DataTable = New DataTable
LOGGER.Debug("Get data from SAP Table", False)
_NewDatatable = New DataTable
LOGGER.Debug("Get data from SAP Table")
Dim oReadTable As New ERPConnect.Utils.ReadTable(SAP_CONNECTION)
If oRaisIncomPack = True Then
If pRaisIncomPack = True Then
LOGGER.Debug("IncomingPackage = True")
oReadTable.PackageSize = 10000
oReadTable.RaiseIncomingPackageEvent = True
End If
NewDatatable = Nothing
If where_clause <> "" Then
oReadTable.WhereClause = where_clause
If pWhere_clause <> "" Then
oReadTable.WhereClause = pWhere_clause
End If
oReadTable.TableName = tablename
oReadTable.TableName = pTablename
If RowLimit <> 0 Then
LOGGER.Debug("RowLimit included!")
oReadTable.RowCount = RowLimit
@@ -174,13 +174,13 @@ Public Class ClassSAP
oReadTbl.Run()
LOGGER.Debug("Table.Run executed")
RESULT_TABLE = oReadTbl.Result
If Not IsNothing(NewDatatable) Then
LOGGER.Debug($"Got [{NewDatatable.Rows.Count}] rows")
'RESULT_TABLE = oReadTbl.Result
If Not IsNothing(_NewDatatable) Then
LOGGER.Debug($"Got [{_NewDatatable.Rows.Count}] rows")
End If
SAP_CONNECTION.Close()
Return NewDatatable
Return _NewDatatable
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Warn("Unexpected Error in SAP Table Result: " & ex.Message)