简体   繁体   English

SAP Java JCO程序ID

[英]SAP Java JCO Program id

I have to get some data with java from a sap. 我必须从树液中获取一些Java数据。

I want to use sap jco, the connection works fine. 我想使用sap jco,连接正常。 But the other company is telling me I have to register to a program id. 但是另一家公司告诉我,我必须注册一个程序ID。

So I tried DestinationDataProvider.JCO_TPNAME in my connection Properties. 因此,我在连接属性中尝试了DestinationDataProvider.JCO_TPNAME But to retrieve some data, I have to call some SAP function? 但是要检索一些数据,我必须调用一些SAP函数吗? Or can the program somehow be executed? 还是可以以某种方式执行程序?

The SAP team has no experience with java jco and I have not much experience with sap. SAP团队没有使用Java JCO的经验,而我没有太多的SAP经验。 Can anybody help me? 有谁能够帮助我?

If you are able to connect to SAP destination, then in order to extract data you can call an SAP function module (which should be RFC enabled ). 如果您能够连接到SAP目标,那么为了提取数据,您可以调用SAP功能模块(应该启用RFC )。


See the following example to execute an SAP function module using JCO (I assume that you are successfully able to connect to SAP). 请参见以下示例,以使用JCO执行SAP功能模块(我假设您已成功连接到SAP)。

  1. Get the SAP destination 获取SAP目标

JCoDestination destination = JCoDestinationManager.getDestination( DESTINATION_NAME ); JCoDestination目标= JCoDestinationManager.getDestination( DESTINATION_NAME );

  1. Get the function 获取功能

JCoFunction function = destination.getRepository().getFunction(< NAME_OF_THE_FUNCTION >); JCoFunction函数= destination.getRepository()。getFunction(< NAME_OF_THE_FUNCTION >);

3. Set the importing parameters (if any) 3.设置导入参数 (如果有)

function.getImportParameterList().setValue(< PARAMETER_NAME >, < PARAMETER_VALUE >); function.getImportParameterList()。setValue(< PARAMETER_NAME >,< PARAMETER_VALUE >);

  1. Execute the function 执行功能

function.execute(destination); function.execute(destination);

  1. Get the return values from exporting parameters of the function module 从功能模块的导出参数中获取返回值

function.getExportParameterList().getString(< PARAMETER_NAME >); function.getExportParameterList()。getString(< PARAMETER_NAME >);


Additionally, you can see the following link to see how to work with JCO. 此外,您可以看到以下链接以了解如何使用JCO。


If you want to build an RFC server using JCO, the following link might be useful. 如果要使用JCO构建RFC服务器,则以下链接可能有用。

I had to build an JCO Server, where I can register to a program id and get updates from the SAP system. 我必须构建一个JCO服务器,可以在其中注册一个程序ID并从SAP系统获取更新。 On my first step I tried to build a JCO Client, which was wrong 第一步,我试图建立一个JCO客户,这是错误的

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

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