一、SAPRFC 介绍:
SAPRFC is a extension module for PHP 4 and PHP 5. With SAPRFC is possible call
ABAP function modules in SAP R/3 from PHP scripts. You can use the powerful PHP
language to create a web applications or interface programs with a connectivity to the
SAP R/3. You can also write RFC server program in PHP and call PHP functions from
SAP R/3.Client example.Server example.
更多内容可访问其官方网站:http://saprfc.sourceforge.net/
二、下载 SAPRFC,最新版本为1.4.1:
http://sourceforge.net/projects/saprfc/files/saprfc/1.4.1/saprfc-1.4.1.All.zip/download
该包里面含有 php_saprfc_449.dll php_saprfc_528.dll php_saprfc_528_nts.dll
php_saprfc_530.dll php_saprfc_530_nts.dll 文件,请根据您的PHP 版本选择相应文件复制
到PHP 的安装目录下ext 文件夹。
修改 php.ini 文件,在其中加入一行:
extension=php_saprfc_528.dll
(假设您的PHP 是5.2.8 版本)
保存并重新启动 PHP,访问phpinfo();就可以看到:
表明 SAPRFC 已经安装成功。
三、实际运行:
把下载的包解压到网站目录下,打开 example_userlist.php,修改其中的SAP 登录代码:
可以看到其中调用了SAP 标准的函数:SO_USER_LIST_READ,代码非常简单:
运行结果:
为了实现某些功能可用 SE37 定义RFC 函数,然后用PHP 调用,下面是个小例子:
四、存在的问题:
PHP 当然是支持中文的,但SAPRFC 提供的.DLL 文件好像并不支持中文,非常纠结。
评论