SAP and sapjco3 print a list of BAPIs in my java p

2019-05-21 04:00发布

I am a new comer to both SAP and JCo. I established connection to a SAP Server and I would like to print a list of BAPIs in my program . is there any way to do it?? I am using sapjco3.jar

标签: java sap bapi jco
4条回答
何必那么认真
2楼-- · 2019-05-21 04:23

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...

查看更多
做自己的国王
3楼-- · 2019-05-21 04:26

You can use the BAPI_MONITOR_GETLIST to get a list of all BAPIs in your system together with meta data.

查看更多
你好瞎i
4楼-- · 2019-05-21 04:40

You could make an ABAP function searching for all RFC functions in table TFDIR, with FMODE ='R' (remote). However, This will give you all remote-callable function, not only BAPIs.

查看更多
做个烂人
5楼-- · 2019-05-21 04:49

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);
查看更多
登录 后发表回答