Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print a list of BAPIs using JCo

I established connection to a SAP Server and I would like to print a list of BAPIs in my Java program. I am using sapjco3.jar.

Is there any way to do it?

like image 233
Prabhakar Manthena Avatar asked Jul 04 '13 06:07

Prabhakar Manthena


2 Answers

You can also use the function module SWO_QUERY_API_METHODS. The following code snippet works with JCo 2:

IFunctionTemplate functionTemplate = Repository.getFunctionTemplate("SWO_QUERY_API_METHODS");
JCO.Function function = functionTemplate.getFunction();
mConnection.execute(function);

ParameterList exportParameter = function.getExportParameterList();
System.out.println("exportParameter: " + exportParameter);
ParameterList importParameter = function.getImportParameterList();
System.out.println("importParameter: " + importParameter);
ParameterList tableParameter = function.getTableParameterList();
System.out.println("tableParameter: " + tableParameter);
like image 153
dweisser Avatar answered Sep 28 '22 16:09

dweisser


As far as I know, there is no "BAPI to get a list of BAPIs", so this would be a non-trivial task. You could try to use RFC_FUNCTION_SEARCH to search for function modules named BAPI*, but that's not guaranteed to give you a) only official BAPIs and b) all of the official BAPIs...

like image 31
vwegert Avatar answered Sep 28 '22 15:09

vwegert