Skip to Content
0
Former Member
Nov 28, 2004 at 12:21 PM

Problem in calling RFC from VB.Net

16 Views

Hi,

I'm having trouble calling an RFC from VB.net the code I'm using is shown below. I get an error "Object reference not set to an instance of an object", I dont know what I'm doing wrong, any help would be appreciated as I need to solve this problem urgently.Thanks in advance

Anand

Dim objProxy As New SAPProxy1.SAPProxy1()

Dim Claim_struct As New SAPProxy1.YFS_EMP_CLAIM()

Claim_struct.Bldat = dsSAPData.Tables("HeaderTable").Rows(0)("BLDAT")

Claim_struct.Xblnr = dsSAPData.Tables("HeaderTable").Rows(0)("XBLNR")

Claim_struct.Bukrs = dsSAPData.Tables("HeaderTable").Rows(0)("BUKRS")

YfS_EMP_CLAIMTable1.Add(Claim_struct)

Claim_struct.Bldat = dsSAPData.Tables("DetailTable").Rows(0)("BLDAT")

Claim_struct.Xblnr = dsSAPData.Tables("DetailTable").Rows(0)("XBLNR")

Claim_struct.Bukrs = dsSAPData.Tables("DetailTable").Rows(0)("BUKRS")

YfS_EMP_CLAIMTable1.Add(Claim_struct)

Dim iErrorCode As Integer = -1

Dim sErrorText As String = "No Error"

Dim sDocumentId As String = "No DocumentId"

Try

--> Error on the next line "Object reference not set to an instance of an object"

objProxy.Y_Employee_Claim(iErrorCode, sErrorText, sDocumentId, YfS_EMP_CLAIMTable1)

Catch ex As Exception

Server.Transfer("error.aspx?Message =" & ex.Message)

End Try