MS0211
This commit is contained in:
@@ -158,4 +158,73 @@ Public Class ClassSAP
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function LINK_ARC_OBJECT(table As String, barcode As String, contrep As String, docid As String, ardate As String, doctype As String)
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> CREATE_ARC_OBJECT", False)
|
||||
Dim sapfunc As RFCFunction = SAP_CONNECTION.CreateFunction("BAPI_BARCODE_SENDLIST")
|
||||
|
||||
'Create and fill the frist row
|
||||
Dim row As RFCStructure = sapfunc.Tables(table).AddRow()
|
||||
row("BARCODE") = barcode
|
||||
row("CONTREP") = contrep
|
||||
row("DOCID") = docid
|
||||
row("ARDATE") = ardate
|
||||
row("DOCTYPE") = doctype
|
||||
|
||||
' Execut e the function
|
||||
sapfunc.Execute()
|
||||
|
||||
' process return structure
|
||||
Dim ret As RFCStructure = sapfunc.Imports("RETURN").ToStructure()
|
||||
|
||||
If (ret("TYPE").ToString().Equals("")) Then
|
||||
Console.WriteLine("No error reported")
|
||||
Return ""
|
||||
Else
|
||||
Return ret("MESSAGE")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Unexpected Error in SAP Table Result: " & ex.Message, False)
|
||||
MsgBox("Unexpected Error in CREATE_ARC_OBJECT: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Return ex.Message
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function INSERT_ARCHIVE_OBJECT(ARCHIV_ID As String, ARC_DOC_ID As String, AR_OBJECT As String, OBJECT_ID As String, SAP_OBJECT As String, DOC_TYPE As String, table As String)
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> INSERT_ARCHIVE_OBJECT", False)
|
||||
Dim sapfunc As RFCFunction = SAP_CONNECTION.CreateFunction("ARCHIV_CONNECTION_INSERT")
|
||||
|
||||
'Create and fill the frist row
|
||||
'Dim row As RFCStructure = sapfunc.
|
||||
sapfunc.Exports("ARCHIV_ID").ParamValue = ARCHIV_ID
|
||||
sapfunc.Exports("ARC_DOC_ID").ParamValue = ARC_DOC_ID
|
||||
sapfunc.Exports("AR_OBJECT").ParamValue = AR_OBJECT
|
||||
sapfunc.Exports("OBJECT_ID").ParamValue = OBJECT_ID
|
||||
sapfunc.Exports("SAP_OBJECT").ParamValue = SAP_OBJECT
|
||||
sapfunc.Exports("DOC_TYPE").ParamValue = DOC_TYPE
|
||||
' row("AR_DATE") = AR_DATE
|
||||
' Execut e the function
|
||||
Try
|
||||
sapfunc.Execute()
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in sapfunc.Execute: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Dim ret As RFCStructure = sapfunc.Imports("RETURN").ToStructure()
|
||||
|
||||
If (ret("TYPE").ToString().Equals("")) Then
|
||||
Console.WriteLine("No error reported")
|
||||
Return "ERROR in Function Execute"
|
||||
Else
|
||||
Return ret("MESSAGE")
|
||||
End If
|
||||
End Try
|
||||
' process return structure
|
||||
Return ""
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Unexpected Error in INSERT_ARCHIVE_OBJECT: " & ex.Message, False)
|
||||
MsgBox("Unexpected Error in INSERT_ARCHIVE_OBJECT: " & ex.Message, MsgBoxStyle.Critical)
|
||||
Return ex.Message
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user