cancel
Showing results for 
Search instead for 
Did you mean: 

Server program not retrieving values from RFC

Ash_ok
Contributor
0 Kudos

Hi,

a. Created a RFC in SAP CRM with import and export tables (structures).

b. Created a server program using SAP .NET Connector referring the RFC.

b. Created a SM59 transaction as a registered program for the above server program. Connection tested successfully.

d. Created a program to call the RFC. Data is being sent from the program, but the server program is not retrieving the values, though it identifies the structure correctly. I have even tried setting the 'IsNestedType1' property of the import and export tables to 'TRUE', but to no effect.

Is this a bug ? Have I missed out on anything ?? Any suggestions ???

Cheers,

Ashok.

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

You should turn RFC trace on and check what is transfered over the wire.

elko_hasse
Participant
0 Kudos

Where do I turn Trace on ?

I realized a .NET Server and everything works fine. But how can i check within the server, if the Server connected to SAP Gateway correctly. If I start the Server with Incorrect Gateway IP, there is no error - It is even possible to Start and Stop the server and the ServerHostStaus property of the host is on "StartPending".

There must be a way to know after starting the Server (Method Start on SAPServer object), if the connection was successful or if error occured.

Whats about the NCoTrace Class ?

Who can help ?

regards

elko

Steven_UM
Contributor
0 Kudos

Hi,

1) You can enable the tracing within SAP via transaction SM59.

2) You can check on the status by deriving a new class from the 'SAPServerHost' class and implement the onServerException method. This method is called whenever an RFC problem occurs so you can use it to catch the errors and do whatever you want to ... (writing to an exception file, console output, etc .... )

Bye,

Steven

Former Member
0 Kudos

Do you know if "onServerException" will be fired if the SAP server goes off-line?

elko_hasse
Participant
0 Kudos

I dont know. But it is not working. I derived a new class from SAPServerHost and implemented a simple console output in onServerException.

I started the server with a fake gateway IP address. But the Method onServerException is not executed. The Server seems to start normally, no hint that there was no connection to the SAP gateway.

Any help ?

I will look into .netco2 beta that was released today, maybe some hints there.

elko

Former Member
0 Kudos

I have some corresponding problems. I get some data, but in every field of my Table the value of the first field is in. When I look at my table in SAP, everything is correct.

But in C# the values of all fields beside the first field are overridden by the value of the first field.

Has anybody an idea what went wrong??

Former Member
0 Kudos

Hello,

As you are manually fabricating the structure layout instead of using .NET Connector wizard to generate code for you, the chance that you make it wrong is above 90%.

Obviously, the field offsets for your structure are wrong.

Regards,

Guangwei Li