cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Server with TCP / IP destination "Start"?

Former Member
0 Kudos

Hi all,

I am glad having found this forum

Here is what I would like to do: I want to install a RFC Server on the client. Upon a user's button click an ABAP Program collects the data from the screen and sends it to my RFC .NET Server (on the users's computer) by the command 'Calling function x Destination y'. The information is processed by the RFC Server and afterwards used to start another client application.

Of course I do not want to maintain a RFC destination for every client (~400) to keep it unique. So it would be nice to have a RFC destination of type "Start". But when I look at the samples I have no idea how to pass the parameters to my RFC Server if it is a "Start" destination.

Has anyone an idea? Any help would be really appreciated!

Thanks in advance

vincvega

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

I am really glad to see this forum.

I am new to SAP.

I have designed .net Server stub function to implement RFC Server.

But i don't know how to proceed further for registering it with SAP GUI?

How to use it in ABAP?

Only implemnting that function in RFC server is enough or we have to register it by writing code in RFC server.

Is there any total documentation that explains how to do it?

Please help it's urgent.

reiner_hille-doering
Active Contributor
0 Kudos

You can specify that your RFC server is started from the GUI at the GUI-host. This is almost exactly what you want. However you must note that the .NET Connector is not specially made for this situation.

When you create such a destiantion and enter the path to your .NET Rfc Server it is started by the GUI with some parameters that the sample code cannot handle correctly.

You would need to change the sample code to transform the command line and create a single SAPServerImpl instance with the correct parameters. When I have time I will create a sample and post it. Anyway, we are current working on this issue to make it easier for you to use.

Regards,

Reiner.

Former Member
0 Kudos

Hello Reiner,

I am sorry to disturb you again but I am totally hung up at the moment...

I found out that there are four parameters passed when I start my RFC server on the user's Workstation: hostname, gatewayservcie, some sort of number (10 digits?) and an entry "IDX=0". I do not know how to use the two last parameters. I tried to use the number as the progID in the Connectionstring but that didn't work either. Could you tell me how to map the parameters or where I can find some documentation how to do it? Is there anything else to do?

Answers to my questions would be really great

Thanks - vincvega

Former Member
0 Kudos

These parameters are internal to the RFC library. When an RFC server is called in "start" mode on the front-end workstation, the SAP application server instructs the SAPGUI to start a new instance of the program.

When it does this, as you noted, the SAPGUI starts the program with certain internal command-line parameters. At a lower level, these parameters get passed to the RFC SDK's RfcAccept function and instructs the program to connect back to the identified gateway using a pre-allocated RFC conversation.

This is different to the registered RFC server approach, where a program is already started and registers itself with an SAP application (gateway) server with a pre-configured program ID.

Unfortunately, I am not familiar enough with the .NET connector, but if this were a non-.NET connector program, then all you would need to do is invoke RfcAccept, something like (my C is rusty!):


int main(int argc, char ** argv)
{
  int rfcHandle;
  rfcHandle = RfcAccept(argv);
  if rfcHandle == RFC_HANDLE_NULL
  {
    // Error handling
  }
  // Install RFC functions...
  repeat
    rc = RfcDispatch(rfcHandle);
  until (rc != RFC_OK);
}

Scott

Former Member
0 Kudos

Hi Scott,

thanks for your answer.

I was looking for a method in the .NET Connector. But as it seems there isn't one. As Reiner said there seems a way to connect via the .NET Connector by mapping the given parameters.

Maybe there is someone who could help me with that - I cannot continue my work until this is solved?

Thanks - vincvega

reiner_hille-doering
Active Contributor
0 Kudos

Hello vincvega,

I have check it and unfortunately there seems no way to get it running with the current built of SAP .NET Connector. This is because the .NET connector SAPServer class allways overwrites the "original command line connection string" with one that tries to register at the server.

We are currenly in the process of building a patch version that solves the problem.

You could open a CSN message and report it as a bug - this might speed up the creation of a fix.

Regards,

Reiner.

Former Member
0 Kudos

Hello Reiner,

Until your fix will be available we will use a workaround that will do for us.

Nevertheless I thank you for your endeavors to assist!

Regards,

vincvega