简体   繁体   English

使用 JCo 打印 BAPI 列表

[英]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.我建立了到 SAP 服务器的连接,我想在我的 Java 程序中打印 BAPI 列表。 I am using sapjco3.jar.我正在使用 sapjco3.jar。

Is there any way to do it?有什么办法吗?

You can also use the function module SWO_QUERY_API_METHODS .您还可以使用功能模块SWO_QUERY_API_METHODS The following code snippet works with JCo 2:以下代码片段适用于 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);

As far as I know, there is no "BAPI to get a list of BAPIs", so this would be a non-trivial task.据我所知,没有“获取 BAPI 列表的 BAPI”,所以这将是一项重要的任务。 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...您可以尝试使用RFC_FUNCTION_SEARCH来搜索名为BAPI*功能模块,但这并不能保证给您 a) 仅官方 BAPI 和 b) 所有官方 BAPI ...

您可以使用 BAPI_MONITOR_GETLIST 来获取系统中所有 BAPI 的列表以及元数据。

You could make an ABAP function searching for all RFC functions in table TFDIR, with FMODE ='R' (remote).您可以使用 FMODE ='R'(远程)使 ABAP 函数搜索表 TFDIR 中的所有 RFC 函数。 However, This will give you all remote-callable function, not only BAPIs.但是,这将为您提供所有可远程调用的功能,而不仅仅是 BAPI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM