Skip to Content
avatar image
Former Member

Referencing internal RFC destaination via .NET

I have a requirement to call RFC's on multiple app servers from an external .NET application. For example, I need to call TH_SERVER_LIST, then loop through the list calling TH_WPINFO DESTINATION <appserver> for each application server.

I have not been able to determine how to specify a new RFC destination in the RFC call (using C#).

What is the mechanism to specify a different (internal or R/3 type) RFC destination once the initial logon connection information has been established?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 14, 2004 at 03:56 PM


    There is no such things that allow you to specify a different internal destination based on the initial connection. You need to make a new connection for each server when you loop through the server list returned by TH_SERVER_LIST. The C# code should look like this:

    SAPProxy1 proxy = new SAPProxy1(xxxxx xxx xxx);

    ServerTable list = new ServerTable();

    proxy.TH_SERVER_LIST(... ref list);

    foreach(Server server in list)


    string format = "ashost={0} sysnr=xx user=xxx ...";

    string connString = String.Format(format,;

    proxy.Connection = new SAPConnection(connString);





    You can also write a customer ABAP function module that calls TH_WPINFO within ABAP. This way, you just need a single connection in C#.

    Hope it helps,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      I suspected as much but was hoping I was missing a trick!

      I appreciate the extra mile to provide sample code.