cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform an RFC on all instances of an 4.6c system?

Former Member
0 Kudos

I want to get all the workload statistics records (STAD data) for all instances in a 4.6c system. I am doing this from another program and am using JCo to communicate with the SAP system, so I need to use remote-enabled function modules.

In 4.6c, STAD uses SAPWL_READ_STATISTIC_FILES to get the statistics records for all instances. But this FM is not remote-enabled so I cannot use it.

SAPWL_STATREC_READ_FILE is remote-enabled, but it gets the statistics records just for the 'current' instance, the one executing the FM. I could use this function, if I could iterate over the instances making the RFC to each one.

The question is how to connect to each instance and do the RFC? Or maybe how to tell one instance to issue the RFC to all instances?

Any ideas appreciated. Thanks.

--

Tim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Thats all you have to do. In the loop create always the JCO connection to the instance you want to connect to. Put all your instance data into a Collection and iterate over it.

Regards

Daniel

Former Member
0 Kudos

Sounds easy. I will test the solution next week. If it works, I'll close the question.

Thanks, Daniel.

--

Tim

Former Member
0 Kudos

> In the loop create always the JCO connection to the instance you want to connect to.

What if the system is load balancing across instances? Can I still iterate over the instances and connect to each one?

Thanks.

--

Tim

Former Member
0 Kudos

Hi,

As I understand your scenario it's not relevant if the system are load balanced or not, 'cause you need information about one instance at one special timepoint.

But you could also use load balacing functionallity. There are two createClient(..) methods which supports load balancing (have a look at the JCo Java Docs how to implement them).

Regards,

Daniel

Former Member
0 Kudos

I don't want to use the load balancing feature; I want to ensure I am not prohibited from logging on to a particular instance if the system is doing load balancing. From your comments, I infer this is true.

The solution requires being able to logon to each instance and it has to work even if the system is load balancing, is using SAPRouter, has a getway, etc. I am trying to convince myself that it will work for all those scenarios.

Thanks again.

--

Tim

Former Member
0 Kudos

Hi,

Your JCo client connection (or better say your application server) is defined through SID, hostname/IP, SYSNO, user, password. So you could be sure, that you always connect to the defined instance (and not any other in your system landscape).

But be sure to connect to the physical instance and not to Web Dispatcher/Load Balancer, Dialog Instance, or what else ...

Regards,

Daniel

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Create your own FM which is RFC enabled and calls SAPWL_READ_STATISTIC_FILES. Then you can call your own FM from your Java client and you'll get al you want.

Or if you want do it on the Java side use a loop (e.g. a for loop). Within the loop create the JCO connection (for the instance you would connect), call FM SAPWL_STATREC_READ_FILE, get your data from FM and close the JCO connection).

If you need some code exmple. don't be afraid to ask!

Regards,

daniel

Former Member
0 Kudos

Thanks, Daniel!

Yes, I want to do it on the Java side; I do not want to modify the SAP system.

How do I specify a particular instance when I login? I know there are several connection methods in JCo. We are using one is this:

jco.client.ashost=sapci1

jco.client.client=<client>

client.sysnr=00

jco.client.user=<user>

jco.client.passwd=<pwd>

Do I just specify a different ashost and/or sysnr to logon to a different instance?

I see I can get the list of instances from RFC_GET_LOCAL_SERVERS. From that I can get the list of hosts and system number to iterate over.

--

Tim