I am a newcomer to both SAP and JCo. I would like to obtain, via JCo, a
list of BAPIs supported by an SAP system.
Requires Free Membership to View
When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.
Hannah Smalltree, Editorial DirectorBased on my reading of the JCo doc, I believe after creating a JCo.Repository, I could invoke JCo.Repository.getCachedFunctionInterfaces() to obtain a String array of supported BAPIs. Is this so? Do I need to do some "loading" of the repository that I created? Will the following code do what I want it to do (ie., print all the BAPIs supported in the SAP system that I have connected to)?
JCO.Client JCOClient;
IRepository SAPRep;
String[] SAPInterfaces;
JCOClient = JCO.createClient (client, user, passwd, lang, url);
JCOClient.connect();
SAPRep = new JCO.Repository (repositoryName, JCOClient);
SAPInterfaces = SAPRep.getCachedFunctionInterfaces();
System.out.println ("List of Functions in Repository:n"); System.out.println ("================================n");
for (int count = 0; count < SAPInterfaces.length; count++) {
System.out.println (SAPInterfaces[count] + "n"); }
Many thanks.
getCachedFunctionInterfaces() only returns the runtime metadata of all RFMs used so far. To get a list of all supported BAPIs you need to call SWO_QUERY_API_METHODS. If you want a full-blown Metadata Server for SAP written in Java, send me an email (tgs@arasoft.de).
This was first published in May 2002