How can I get a JCo list of supported BAPIs?

How can I get a JCo list of supported BAPIs?

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 Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.


Based 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