RFC SDK 指南 客户端程序的编写

来源:互联网 发布:恋夏500日 知乎 编辑:程序博客网 时间:2024/05/29 19:40

An external RFC client program calls a remote RFC function. The following steps have to be conducted by an external RFC client:
1. Open an RFC-Connection. In this phase a valid RFC client handle will be created.
2. Call one or more remote RFC functions.
3. Close or terminate an RFC connection. The valid RFC handle will invalidate. All connection data is lost.

 

一个外部RFC客户端程序调用远程RFC函数。通过以下步骤使外部客户端访问SAP R/3:

    1.打加一个RFC连接。这一阶段,一个有效的RFC客户句柄被创建。

    2.调用一个或多个远程RFC函数。

    3.关闭或终止一个RFC连接。有效的RFC句柄将失效。所有连接数据将丢失。

 Open an RFC-Connection(打开一个RFC连接)
To create a valid RFC client handle, it is necessary to establish an RFC connection to an RFC partner. The following connection types are possible:
    • Connection to a R/2-System
    • Connection to an R/3 System
    • Connection to an external RFC server

 

创建一个有效的RFC客户句柄,是建立一个RFC连接必须的。可能有下列连接类型:

连接到R/2系统

连接到R/3系统

连接到外部RFC服务器


Every RFC connection will be established in two steps:
    • Connection from an RFC program to an SAP gateway
    • Connection from the SAP gateway to an RFC server

 

创建一个RFC连接需要执行以下两步:

    从客户端连接到SAP网关

    从SAP网关连接到RFC服务器

 

A connection to a remote RFC server has to be established via RfcOpenEx API-call. This API takes as input parameter a zero terminated string with connection data and returns an RFC handle. If the connection was successfully established, the handle is valid. If the handle is returned, it is invalid and has the value RFC_HANDLE_NULL.

 

使用RfcOpenEx API创建一个到远程RFC服务器的连接。这个API的输入参数是一个包含连接信息的以0结尾的字符串并且返回一个RFC馇。如果这个连接成功建立,这个句柄就是有效的,否则返回一个值为RFC_HANDLE_NULL的无效句柄。

 

It is possible to precede the logon check during opening of an RFC connection.
To create an RFC connection the following data is needed:
• Connection data. This data is necessary to establish the connection to the RFC server.
• Logon data (user identity, client and logon language). This data is used for logon to the given R/3 system.
• Additional data. By using this data, some connection features can be customized. For example, it is possible to turn the RFC trace on, start SAPGUI to open time etc.

 

在打开一个RFC连接之前需要进行登录验证。创建一个有效的连接需要以下数据:

  连接数据(用户标识,客户端和登录语言).这些数据对于给定的R/3系统是有用的。

  附加数据。使用这些数据,可定义一些连接的特性。比如:打开RFC的调试功能,当打开连接时显示SAP界面等。

 

Abbreviator BAER2 (B - load Balancing, A - explicit Application server, E - External RFC program, R - Registered RFC server, 2 - R/2 connection) could describe the connection kinds.
The connection string has to have the following format: “ID=value ID=value ... ID=value”.

 

缩写 BAER2(B:负载均衡,A:明确的应用服务器,E:扩展RFC应用程序,R:注册的RFC服务器,2:R/2连接器)可以描述连接的类型。

连接字符串格式如下:“ID=value ID=value ... ID=value”.

 

 

It is possible to only declare the data in the connection string. In this case all necessary connection data is defined as input parameter of RfcOpenEx API.

 

声明的数据仅在连接字符串中使用。在这种情况下,所有连接数据均在RfcOpenEx API的输入参数中声明。

 

Another way is to declare the data in the saprfc.ini file. To use the saprfc.ini file, the connection parameter string must have the following entry: “DEST=<your destination in saprfc.ini file>”. In this case the corresponding entries from the sapRFC.ini file will be used to establish the connection.

 

另一种方法是在saprfc.ini文件中声明连接数据,连接字符串必须拥有如下入口:“DEST=<your destination in saprfc.ini file>”. 如果是这样,在saprfc.ini文件中相应的入口用来创建连接。

 

A third possibility is to use the SAPLOGON data (this is available for Windows platforms only). To use the connection data from sapmsg.ini file, the connection string must have the following entry: “SAPLOGON_ID=<entry from saplogon> “.

 

第三种访求就是使用SAPLOGON(仅在Windows平台使用)使用sapmsg.ini文件中的连接数据,连接字符串必须有如下声明:“SAPLOGON_ID=<entry from saplogon> “.

 

原创粉丝点击