cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Server Error Message

Former Member
0 Kudos

I am trying to get the sample exercise to work ("How to build a simple RFC server") and I am able to create the RFC server and connect with SAP but when I try to run the test of the function module via SE37 it gives me an error "Object reference not set to an instance of an object". I am not a VB developer so I am not sure what would cause such an error. Any help is greatly appreciated.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

You are correct it is from a sample "Client" app, and I am trying to do a server. My mistake. But I still cannot explain why the exception occurs on my definition of RFC_GET_CUSTMER. It gives me the message "Object reference not set to an instance of an object". Should I be declaring this somewhere? The example didn't say anything about it.

Former Member
0 Kudos

When I set this to debug exceptions it stops at my definition of "RFC_GET_CUSTOMER" saying an instance of the object has not been created. If I navigate to SAPProxy1.vb in a sample that is provided with NCo, it shows the following line that doesn't exist in my example:

Dim results As Object()

results = SAPInvoke("Rfc_Customer_Get", new Object() { _

Kunnr,Name1,Customer_T })

Customer_T = CType(results(0), BRFCKNA1Table)

If I try to add this line of code to my copy I get an error saying "SAPInvoke" is not defined.

Any thoughts?

reiner_hille-doering
Active Contributor
0 Kudos

There must be something wrong. The title mentions that you want to create an RFC server, but the code that you posted is clearly from an RFC client. So what do you want to achieve?

reiner_hille-doering
Active Contributor
0 Kudos

Run your RFC server in the debugger (in VS) and turn on first-chance-exception-handling (Menu Debug->Exceptions...->CLR Runtime Exceptions->Break into the debugger.

As soon as the exception happens in VB, the program will stop and show you where.

Former Member
0 Kudos

I meant to say SE37.

Former Member
0 Kudos

Yes, I am running via SM37 with the destination specified. I did confirm that I was using the correct RFC Destination.

Former Member
0 Kudos

Are you running the function module in SE37 with RFC destination?

Thanks & Regards,

Govind.