cancel
Showing results for 
Search instead for 
Did you mean: 

JCo 3.0 getting List of Remote Functions

Former Member
0 Kudos

Hello Experts!

Please excuse me, if there has been already posted the same or similar question, but I have been looking for ages now without a result.

I am working on a Java-Project using the JCo 3.0. I would need to get a List of all available RFCs in our SAP-System.

Is there such a functionality? Is it built in in the Jco API (I just saw the getFunction(String) method but I would need kind of that but returning a list of Function names)? or is there a remote function in the sap-system that provides a list of all RFCs?

Thank you very much in advance!

Best regards,

Kamil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Him Kamil

I Think there are one RFC which return a list of RFC. I have test in ECC 6 and works fine.

The RFC name is RFC_FUNCTION_SEARCH. You can pass the wildcard * to search all the RFC's.

Regards

Marcos

Former Member
0 Kudos

Hi Marcos!

Thank you very much for your reply. That's exactly what I was looking for

You're the man!

Best regards!

Kamil

oueslati_anis
Participant
0 Kudos

Hello;

  Can you provide me with a code snippets that illustrate how it works,

I am doing so on my side :

System.out.println(" Response: "

  + function.getImportParameterList().getString("FUNCNAME"));

But I am retreiving nothing.

Regards

Anis

former_member193379
Active Contributor
0 Kudos

Hi Anis,

Please find then code below

JCoConnection jcoCon = null;

jcoCon = getDefaultJCoConnection();

JCO.Function function = jcoCon.getJCoFunction(" RFC_FUNCTION_SEARCH");

// set the import values

JCO.ParameterList importParams = function.getImportParameterList();

importParams.setValue(FUNCNAME, "*");

importParams.setValue(GROUPNAME, "*");

// call the function

jcoCon.execute(function);

//get the return table

JCO.Table funcDetailsTable = function.getTableParameterList().getTable("FUNCTIONS");

int totalNoFunc = funcDetailsTable.getNumRows();

if (totalNoFunc > 0) {

  for (int i = 0; i < totalNoFunc; i++) {

  System.out.println("Function Name: "+totalNoFunc.getString("FUNCNAME"));

  }

}  

Thanks,

Hamendra

oueslati_anis
Participant
0 Kudos

Hello,

  Thanks a lot, its working.

Thanks

Answers (0)