Giter Club home page Giter Club logo

php7-sapnwrfc's Introduction

SAP NW RFC extension for PHP 8

Donate

This extension is intended to provide a means for PHP 8 developers to interface with the SAP NetWeaver SDK.

If you find this project useful consider giving me a cup of coffee using the "Donate" button above.

Supported versions

The extension is tested with PHP 8.1+ using SAP NW RFC SDK version 7.50.

The extension should still build for PHP 7.3 and 7.4, but this is no longer supported and might break in the future.

The repository is called php7-sapnwrfc for historical reasons only.

Older versions

The 1.x branch supports PHP 7.2+ with SAP NW RFC SDK version 7.20 supported up to release 1.3.

This version is not maintained any more.

Usage

You can find detailed instructions on how to build and use this extension at https://gkralik.github.io/php7-sapnwrfc.

Contributing

Contribution to the project (be it by reporting/fixing bugs, writing documentaton, helping with testing) is very welcome. Just open up an issue or a PR.

License

This software is licensed under the MIT license. See LICENSE for details.

Legal notice

SAP and other SAP products and services mentioned herein are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries.

php7-sapnwrfc's People

Contributors

gkralik avatar kea avatar mrspoocy avatar thadafinser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php7-sapnwrfc's Issues

Extra spaces being added to all return values it seems

Hi guys!

Stellar job on this php 7 release of the connector. What a lifesaver.

I'm noticing, however, when comparing results to the connector we were using before this, to this connector, that spaces are being added to the end of nearly all values, bot scalar and in table results.

Example:
Call function:
BAPI_CUSTOMER_GETDETAIL1

With import params:
CUSTOMERNO = 2000xxxxx customer number
PI_SALESORG = 33xx

Look at field 'NAME' in result table PE_COMPANYDATA

The value you'll see seems to be padded with spaces (possibly to match the datatype of the field): "ABC Company Inc. ".

This causes us to have to unfortunately trim every value (both scalar and in tables) coming back, which is undesirable from a performance, coding, and bug-management perspective (sometimes we may forget to do this in instances and the bug will slip through).

Failed to set TABLE row, expected array

We've been wrestling with this one a bit - am getting message "Failed to set TABLE row, expected array" when calling BAPI_SALESORDER_CREATEFROMDAT2. It would be great if in a downstream version -- if possible -- the error message could include which table parameter it is complaining about. There are a bunch of tables for this BAPI and we're having a hard time figuring out which is the offending item : )

We're calling BAPI_SALESORDER_CREATEFROMDAT2 with the following data:

            [ORDER_HEADER_IN] => Array
                (
                    [DOC_TYPE] => Y0OR
                    [SALES_ORG] => 3310
                    [DISTR_CHAN] => 00
                    [DIVISION] => 00
                    [PURCH_NO_C] => 
                    [COLLECT_NO] => 
                )

            [ORDER_PARTNERS] => Array
                (
                    [0] => Array
                        (
                            [PARTN_ROLE] => AG
                            [PARTN_NUMB] => 0020040938
                        )

                )

            [ORDER_ITEMS_IN] => Array
                (
                    [0] => Array
                        (
                            [ITM_NUMBER] => 00010
                            [MATERIAL] => BC535R
                        )

                    [1] => Array
                        (
                            [ITM_NUMBER] => 00020
                            [MATERIAL] => B0020017
                        )

                    [2] => Array
                        (
                            [ITM_NUMBER] => 00030
                            [MATERIAL] => B0020017
                        )

                )

            [ORDER_CONDITIONS_IN] => Array
                (
                    [0] => Array
                        (
                            [ITM_NUMBER] => 00020
                            [COND_TYPE] => Y0M1
                            [COND_VALUE] => 11.111
                        )

                )

            [ORDER_TEXT] => Array
                (
                    [0] => Array
                        (
                            [TEXT_ID] => Y004
                            [LANGU] => EN
                            [FORMAT_COL] => *
                            [TEXT_LINE] => 
                        )

                )

            [ORDER_SCHEDULES_IN] => Array
                (
                    [0] => Array
                        (
                            [ITM_NUMBER] => 00010
                            [REQ_QTY] => 1
                        )

                    [1] => Array
                        (
                            [ITM_NUMBER] => 00020
                            [REQ_QTY] => 2
                        )

                    [2] => Array
                        (
                            [ITM_NUMBER] => 00030
                            [REQ_QTY] => 1
                        )
                )
        )

The interface is listed here fyi:
http://www.se80.co.uk/sapfms/b/bapi/bapi_salesorder_createfromdat2.htm

ORDER_HEADER_IN is an is an EXPORTING structure. The rest are TABLES parameters. Thus I can't seem to figure out whats wrong : (

Ran a full trace -- doesn't seem to suggest the location of the issue?

image

Error when building for PHP 7.2

Sir, After I am make install and getting error

rm -f /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c.ii /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c.i && cc -E -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/sap/nwrfcsdk/php7-sapnwrfc -DPHP_ATOM_INC -I/usr/sap/nwrfcsdk/php7-sapnwrfc/include -I/usr/sap/nwrfcsdk/php7-sapnwrfc/main -I/usr/sap/nwrfcsdk/php7-sapnwrfc -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/sap/nwrfcsdk/include -DHAVE_CONFIG_H -g -O2 -std=c99 -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX -DSAPwithUNICODE -D__NO_MATH_INLINES -DSAPwithTHREADS -DSAPonLIN -minline-all-stringops -fno-strict-aliasing -fno-omit-frame-pointer -fexceptions -funsigned-char -Wall -Wno-uninitialized -Wno-long-long -Wcast-align -pthread -fPIC /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c -o /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c.ii && perl ./scripts/u16lit.pl -le /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c.ii && /bin/bash /usr/sap/nwrfcsdk/php7-sapnwrfc/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/sap/nwrfcsdk/php7-sapnwrfc -DPHP_ATOM_INC -I/usr/sap/nwrfcsdk/php7-sapnwrfc/include -I/usr/sap/nwrfcsdk/php7-sapnwrfc/main -I/usr/sap/nwrfcsdk/php7-sapnwrfc -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/sap/nwrfcsdk/include -DHAVE_CONFIG_H -g -O2 -std=c99 -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSAPonUNIX -DSAPwithUNICODE -D__NO_MATH_INLINES -DSAPwithTHREADS -DSAPonLIN -minline-all-stringops -fno-strict-aliasing -fno-omit-frame-pointer -fexceptions -funsigned-char -Wall -Wno-uninitialized -Wno-long-long -Wcast-align -pthread -fPIC -c /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c.i -o sapnwrfc.lo /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:90:89: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 _ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_getAttributes, IS_ARRAY, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:93:80: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 END_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_ping, _IS_BOOL, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:97:119: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 arginfo_Connection_getFunction, 0, 1, IS_OBJECT, "SAPNWRFC\\RemoteFunction", 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:101:81: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 ND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_close, _IS_BOOL, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:104:95: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 ITH_RETURN_TYPE_INFO_EX(arginfo_Connection_setIniPath, 0, 1, _IS_BOOL, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:108:89: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 _ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_reloadIniFile, _IS_BOOL, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:111:96: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 TH_RETURN_TYPE_INFO_EX(arginfo_Connection_setTraceDir, 0, 1, _IS_BOOL, NULL, 1) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:115:98: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 _RETURN_TYPE_INFO_EX(arginfo_Connection_setTraceLevel, 0, 1, _IS_BOOL, NULL, 1) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:119:84: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 BEGIN_ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_version, IS_STRING, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:122:87: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO" passed 4 arguments, but takes just 3 IN_ARG_WITH_RETURN_TYPE_INFO(arginfo_Connection_rfcVersion, IS_STRING, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:126:95: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 ITH_RETURN_TYPE_INFO_EX(arginfo_RemoteFunction_invoke, 0, 1, IS_ARRAY, NULL, 0) ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:135:106: error: macro "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX" passed 6 arguments, but takes just 5 TYPE_INFO_EX(arginfo_RemoteFunction_isParameterActive, 0, 1, _IS_BOOL, NULL, 0) ^ Makefile:200: recipe for target 'sapnwrfc.lo' failed make: *** [sapnwrfc.lo] Error 1``

I am using SAP NW RFC SDK 7.20, PHP 7.1.10-1+ubuntu16.04.1+deb.sury.org+1

Please Help

Function parameter lost

It seems that the function invoke parameters are lost

PHP7

$conn = new SapConnection($config);

$parameters = [
    'FMI_MATNR' => '887070'
];

$func = $conn->getFunction('Z_PPP_MAT_GET_METADATA');
$result = $func->invoke($parameters);
var_dump($result);

Trace

>> RfcOpenConnection
>> RfcOptions
    // ...
<< RfcOptions

>> RfcConnection name="none"
Handle = 108726000 ConvID = 42090651
<< RfcConnection

<< RfcOpenConnection returned RFC_OK

>> RfcGetFunctionDesc
RfcGetFunctionDesc(Z_PPP_MAT_GET_METADATA) via handle 108726000
RfcGetFunctionDesc(Z_PPP_MAT_GET_METADATA) via handle 108726000 (SID=T11) returned 00000000067237F0
<< RfcGetFunctionDesc returned RFC_OK

>> RfcInvoke
Invoking Z_PPP_MAT_GET_METADATA on handle 108726000

>> RfcFunction name="Z_PPP_MAT_GET_METADATA"
>> IMPORTING parameters
>> FMI_LAEDA, RFCTYPE_DATE, Length: 16, Active: false, Requested: false
    Value: 0000-00-00
<< FMI_LAEDA

>> FMI_MATNR, RFCTYPE_CHAR, Length: 36, Active: false, Requested: false
    Value: 
<< FMI_MATNR

>> FMI_MTART, RFCTYPE_CHAR, Length: 8, Active: false, Requested: false
    Value: 
<< FMI_MTART

<< IMPORTING parameters

>> CHANGING parameters
<< CHANGING parameters

PHP5

$conn = new sapnwrfc($config);

$parameters = [
    'FMI_MATNR' => '887070'
];

$func = $conn->function_lookup('Z_PPP_MAT_GET_METADATA');
$result = $func->invoke($parameters);
var_dump($result);

Trace

>> RfcOpenConnection
>> RfcOptions
    // ...
<< RfcOptions

>> RfcConnection name="none"
Handle = 22353560 ConvID = 42046954
<< RfcConnection

<< RfcOpenConnection returned RFC_OK

>> RfcGetFunctionDesc
RfcGetFunctionDesc(Z_PPP_MAT_GET_METADATA) via handle 22353560
RfcGetFunctionDesc(Z_PPP_MAT_GET_METADATA) via handle 22353560 (SID=T11) returned 015487C8
<< RfcGetFunctionDesc returned RFC_OK

>> RfcInvoke
Invoking Z_PPP_MAT_GET_METADATA on handle 22353560

>> RfcFunction name="Z_PPP_MAT_GET_METADATA"
>> IMPORTING parameters
>> FMI_LAEDA, RFCTYPE_DATE, Length: 16, Active: true, Requested: false
    Value: 0000-00-00
<< FMI_LAEDA

>> FMI_MATNR, RFCTYPE_CHAR, Length: 36, Active: true, Requested: false
    Value: 887070
<< FMI_MATNR

>> FMI_MTART, RFCTYPE_CHAR, Length: 8, Active: true, Requested: false
    Value: 
<< FMI_MTART

<< IMPORTING parameters

>> CHANGING parameters
<< CHANGING parameters

Windows x86 build for PHP 7.1

Hi, can you help me out by building a php_sapnwrfc-1.1.2-7.1-vc14-ts-x86.dll? I need it for a PHP project and find only x64 or for PHP 7.0.

best regards,
Christian

x86 build for PHP 7.1

Hi @gkralik ,

Thank you for this great extension! The 64bit version of this works just fine, however I am locked into using 32bit due to interfacing with Oracle (so my php has to be x86), and for some reason the 64bit oci connector isn't working. I was hoping you would be able to build a x86 version of this extension for php 7.1.x. I know this is open source and I have tried to build my own without any luck so I thought I would ask. If you are too busy I understand. Thanks again for all your work on this!

Change license to MIT

As this becomes more serious and stable now, I'd like to change the license of this project from PHP-3.01 to Apache-2.0.

The PHP license was only used because it was the default license for the skeleton extension, but I feel more comfortable with Apache-2.0.

As this concerns all contributors, I need your opinion on that, @ThaDafinser. If you're OK with the change, I'll create a PR for it.

The plan would be to have the license changed before the 0.6.0 release, which would be the first beta release now that everything is stable enough for serious testing.

SSO Support

Is there any change that this library will receive SSO ticket login support?

Windows installation issues

Hi,

Thank you for your time developing this project.

I have trouble installing pre-built module on PHP.

My configuration:

What happens: when I run php.exe I obtain "Warning: PHP Startup: Unable to load dynamic library '\xampp\php\ext\php_sapnwrfc.dll' - %1 is not a valid Win32 application".

I tried all DLLs (TS, NTS, x64, x86), but I have no success ever (with NTS DLL version error is different - of course).

Please, do you have any clue?

Regards
Danilo

ask

i want to ask about, where is the file :
use SAPNWRFC\Connection as SapConnection;
use SAPNWRFC\Exception as SapException;

i using php5.
in documentation, i must download SAP NW RFC library.
is it not provided in the php7 folder?

Error while starting PHP with php_sapnwrfc

Hi,

I'm affraid I cannot use your module. I installed Apache/2.4.25 (Win64) with PHP 7.0.15 x64 TS as a module on Windows Server 2012.

There is no problem without php_sapnwrfc and everything works smoothly. However when I add
extension=php_sapnwrfc.dll
to php.ini (as stated in README.md) and restart Apache I get an error:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PrimeSoft\php-7.0\ext\php_sapnwrfc.dll' - The specified module could not be found.\r\n in Unknown on line 0

The file php_sapnwrfc.dll exists. In fact it is "php_sapnwrfc-1.1.1-7.0-vc14-ts-x64.dll" renamed.

Are there any dependencies required? Visual C++ Redistributable for example? I think it already is installed (PHP works)...

Best wishes,
V3sp

error in make

Hi
I have problem in make .so in linux

/app/sap/php7-sapnwrfc/sapnwrfc.c:532:67: error: macro "zend_hash_add" requires 6 arguments, but only 3 given /app/sap/php7-sapnwrfc/sapnwrfc.c:649:32: error: macro "RETVAL_STRINGL" requires 3 arguments, but only 2 given /app/sap/php7-sapnwrfc/sapnwrfc.c:665:32: error: macro "RETVAL_STRINGL" requires 3 arguments, but only 2 given /app/sap/php7-sapnwrf1/sapnwrfc.c:871:68: error: macro "zend_hash_update" requires 6 arguments, but only 3 given

Feedback: Testing on windows

Hello,

like already talked on twitter, i did now a test for the extension on windows.

I've tested all classes/methods, expect (never needed them until yet)

Connection::setIniPath();
Connection::reloadIniFile();

Following things and ideas came to my mind while testing

Rename Connection::attributes();

To Connection::getAttributes() maybe?
https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/sapnwrfc.stubs.php#L71

Trace level off does not work as expected

When i use TRACE_LEVEL_OFF i thought no trace file will be created, but there was minimal one -> error or just a missinterpretion from me?
https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/sapnwrfc.stubs.php#L47

Exception

I could not manage to throw here the Exceptions
https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/sapnwrfc.stubs.php#L68
https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/sapnwrfc.stubs.php#L78

errorInfo to private?

Since there is a public method to get the data (btw that's an awesome info!)
https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/sapnwrfc.stubs.php#L25

Two trace files

When executing this, you'll have two trace files

use SAPNWRFC\Connection as SapConnection;

SapConnection::setTraceLevel(SapConnection::TRACE_LEVEL_BRIEF)
SapConnection::setTraceDir('my-dir');

$config = [...];
$conn = new SapConnection($config);

SapConnection::setTraceDir('another-dir');
$func = $conn->getFunction('A_RFC_FUNCTION');

Strange trace duplication at the start

The call to RfcUTF8ToSAPUC seems to happen pretty often.


........................

<< RfcSetTraceDir returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcUTF8ToSAPUC
<< RfcUTF8ToSAPUC returned RFC_OK

>> RfcOpenConnection


.....................

Windows installation problem

Hi guys,

I've done all steps, why do I get this error?

Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php7.0.10/ext/php_sapnwrfc.dll' - The specified module could not be found.
 in Unknown on line 0
PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Could not open the ICU common library

Hi Guys,

I am getting an apache error that some required dlls can't be found.

Steps so far:

  1. Unpacked and added nwrfcsdk from SAP Marketplace.
  2. Added C:\nwrfcsdk\lib folder to Windows environment variables under PATH
  3. Added php_sapnwrfc.dll extension to php.ini

Receiving the following message in apache error log.
Could not open the ICU common library. The following files must be in the path described by the environment variable "PATH": icuuc34.dll, icudt34.dll, icuin34.dll

The error is occurring when I attempt to connect as follows:
use \SAPNWRFC\Connection as SapConnection; $connection = new SapConnection($myprops);

Any help is much appreciated.

error executing functions in CentOS Linux release 7.3.1611 (Core) 64 bit

Sir I am facing error while executing functions on system using php 7.1 on CentOS Linux release 7.3.1611 (Core) 64 bit kernel 3.10.0-514.2.2.el7.x86_64 .

error: PHP Fatal error: Uncaught Error: Call to undefined function sapnwrfc_rfcversion() in /usr/share/nginx/html/cr/a.php:11
Stack trace:
#0 {main}
thrown in /usr/share/nginx/html/cr/a.php on line 11.

php info says : sapnwrfc

sapnwrfc support enabled
Version 1.0.0
SAP NW RFC SDK 7210.0.40

tried various versions 1.1/1.2 etc

please help

PHP Extensions.

Hello, thanks for this repository, but my php doesn't detect the extension .dll . Can i help me?

0.7.0 release

Please tell me when all is commited to master/develop for the 0.7.0 release.

Then i will build again for windows...i think that release should be already pretty stable.
At least in my cases

Any way to turn off the trace file?

I call this library from multiple directories and it puts dev_rfc.trc wherever I call it.

It creates when I put this in startup parameters:
$parameters = [
'trace' => \SAPNWRFC\Connection::TRACE_LEVEL_OFF,
..
];
Or when I do this
SAPNWRFC\Connection::setTraceLevel(0);
It creates a file telling me I turned the trace level down.

When I copy the sapnwrfc.ini to my current directory and change RFC_TRACE_DIR=/tmp it works correctly, but I can't copy that everywhere I call it.

The sapnwrfc.ini says "By default the NW RFC library looks for the sapnwrfc.ini file
in the current working directory of the process. If you want
to change that behaviour, you can set an alternative directory
using the API RfcSetIniPath()
But I don't know how to do that. I tried calling that from the library, but it didn't seem to do anything.

This is driving me nuts, I'd appreciate any help.

Windows build instructions

Some instructions for building on Windows would be a nice enhancement.But as I personally don't use Windows, I can't provide them.

@ThaDafinser could you provide instructions on doing that? Even if we can add builds to the releases (and I'm a great fan of doing so as it lowers the barrier of using the extension) some people might want to compile themselves.

Provide sapnwrfc.dll 32-Bit

Hello,

Thank you for maintaining this project. Is it possible to provide the sapnwrfc.dll for 32 bit? The SAP Marketplace downloads section does not appear to provide a 32 Bit version of the RFC SDK and MAMP on windows only supports 32 bit. This causes the warning message "%s1 is not a valid Win32 Application" as described in issue 37.

It is proving prohibitively difficult to obtain this 32 bit dll file.

Kind Regards,

Windows shutdown error

Now i get this error on shutdown.

Calling RFC functions before works fine.

This error also comes with the simple command php -m

image

Deactivate nested parameters

Hi guys,

I know we can disable parameters using: activating-deactivating-parameters

Is there any possibility that we can disable table fields?

Example:
We have TBL1 with the following structure:

$tbl1 = [
    'FIELD1',
    'FIELD2',
    'FIELD3',
];

I want to retrieve only FIELD1 and should call something like

$function->setParameterActive('TBL1.FIELD2', false);
$function->setParameterActive('TBL1.FIELD3', false);

Is this possible in NWRFC SDK?

Segmentation fault on BAPI_PO_CREATE

I have a segmentation fault when trying to call BAPI_PO_CREATE

Call BAPI_PO_CREATE1

array(8) [
'POHEADER' => array(7) [
'DOC_DATE' => string (8) "20160218"
'DOC_TYPE' => string (4) "ZPEP"
'PURCH_ORG' => string (4) "ARED"
'PUR_GROUP' => string (3) "PEP"
'VENDOR' => string (10) "0010113261"
'COMP_CODE' => string (4) "1862"
'ITEM_INTVL' => string (0) ""
]
'POHEADERX' => array(8) [
'DOC_DATE' => string (1) "X"
'DOC_TYPE' => string (1) "X"
'PURCH_ORG' => string (1) "X"
'PUR_GROUP' => string (1) "X"
'VENDOR' => string (1) "X"
'CREATED_BY' => string (1) "X"
'COMP_CODE' => string (1) "X"
'ITEM_INTVL' => string (1) "X"
]
'POITEM' => array(1) [
array(15) [
'PO_ITEM' => string (5) "00100"
'DELETE_IND' => string (1) " "
'MATL_GROUP' => string (9) "PRES_PEPI"
'STGE_LOC' => string (4) "PEP1"
'SHORT_TEXT' => string (40) "1-duo femme jeune et femme senior - 1450"
'PLANT' => string (4) "0110"
'VEND_MAT' => string (6) "CM 420"
'PO_UNIT_ISO' => string (3) "PRE"
'NET_PRICE' => string (5) "1.000"
'QUANTITY' => string (6) "183.00"
'PO_PRICE' => string (1) "2"
'TRACKINGNO' => string (7) "1813426"
'RET_ITEM' => string (0) ""
'ACCTASSCAT' => string (0) ""
'MATERIAL' => string (18) "000000000009001740"
]
]
'POITEMX' => array(1) [
array(16) [
'PO_ITEM' => string (5) "00100"
'PO_ITEMX' => string (1) "X"
'DELETE_IND' => string (1) "X"
'MATL_GROUP' => string (1) "X"
'STGE_LOC' => string (1) "X"
'SHORT_TEXT' => string (1) "X"
'PLANT' => string (1) "X"
'VEND_MAT' => string (1) "X"
'QUANTITY' => string (1) "X"
'PO_UNIT_ISO' => string (1) "X"
'NET_PRICE' => string (1) "X"
'PO_PRICE' => string (1) "X"
'TRACKINGNO' => string (1) "X"
'ACCTASSCAT' => string (1) "X"
'RET_ITEM' => string (1) "X"
'MATERIAL' => string (1) "X"
]
]
'POACCOUNT' => array()
'POACCOUNTX' => array()
'POSCHEDULE' => array(1) [
array(2) [
'PO_ITEM' => string (5) "00100"
'DELIVERY_DATE' => string (8) "20160202"
]
]
'POSCHEDULEX' => array(1) [
array(3) [
'PO_ITEM' => string (5) "00100"
'PO_ITEMX' => string (1) "X"
'DELIVERY_DATE' => string (1) "X"
]
]
]
==> error_log <==
[Thu Feb 18 15:38:17.791495 2016] [core:notice] [pid 1185:tid 140262994323264] AH00052: child pid 5992 exit signal Segmentation fault (11)

I feel stupid but ....

....I cannot install the whole thing :|
Followed the installation guide. Zero error but "php -m | more" still doesn't display the line sapnwr.

Tried even with different builds .... actually trying with Php 7.2.5-1+ubuntu17.10.1+deb.sury.org+1

Any idea?

Thx

Consistent method naming and getter

Rename Connection::attributes() to Connection::getAttributes()

Add getter for Exception::$errorInfo: Exception::getErrorInfo() and make the property private.

Convert connection parameter boolean

This one works

$config = [
    // ...
    'LCHECK' => '0',
    'TRACE' => '0',

    // ...
];

but this one not (worked at piersharding/php-sapnwrfc)

$config = [
    // ...
    'LCHECK' => false,
    'TRACE' => false,

    // ...
];

windows dlls for php 7.2

Could you please provide precompiled windows dlls for the latest releases as you did until march 2017? :)
Especially to have working nts dlls for PHP 7.2. Thank you!

how to write data

The code works fantastic to read data.
Can you tell me how to write data to SAP?
using iis server, php7

Does the API support RFCTYPE_TABLE?

Thanks for your work on a PHP / SAP Client.
The RFC which I try to invoke got back this RemoteFunction (using var_dump):

object(SAPNWRFC\RemoteFunction)#2 (9) {
  ["name"]=>
  string(14) "RFC_READ_TABLE"
  ["DELIMITER"]=>
  array(5) {
    ["type"]=>
    string(12) "RFCTYPE_CHAR"
    ["direction"]=>
    string(10) "RFC_IMPORT"
    ["description"]=>
    string(47) "Zeichen für Markierung von Feldgrenzen in DATA"
    ["optional"]=>
    bool(true)
    ["defaultValue"]=>
    string(5) "SPACE"
  }
  ["OPTIONS"]=>
  array(5) {
    ["type"]=>
    string(13) "RFCTYPE_TABLE"
    ["direction"]=>
    string(10) "RFC_TABLES"
    ["description"]=>
    string(40) "Selektionsangaben, "WHERE-Klauseln" (in)"
    ["optional"]=>
    bool(false)
    ["defaultValue"]=>
    string(0) ""
  }
}

but I cant find a format for the OPTIONS parameter.
When I use

$it = $rfc->getFunction('RFC_READ_TABLE');
$it->invoke([
        'DELIMITER' => '|',
        'OPTIONS' => [ 0 => "SNDLAD = '0400008118'" ]
]);

or

$it->invoke([
        'DELIMITER' => '|',
        'OPTIONS' => [ "SNDLAD = '0400008118'" ]
]);

or

$it->invoke(array(
        'DELIMITER' => '|',
        'OPTIONS' => array("SNDLAD = '0400008118'")
));

I got the error: "expected array for parameter OPTIONS "
This SAP RFC works fine with other client programs.
Thanks for your help.

Idea: Exception interface

Create a exception interface, which is extended by ConnectionException and FunctionCallException so you can catch both Exceptions with one try/catch

try {
    $c = new \SAPNWRFC\Connection([
        'ashost' => 'my.sap.system.local',
        'sysnr'  => '00',
        'client' => '123',
        'user' => 'DEMO',
        'passwd' => 'XXXX',
        'trace'  => '0'
    ]);

    $f = $c->getFunction('Z_TEST_FUNCTION');
    $result = $f->invoke([
        'CHAR1' => 'A',
        'TABL' => [
            ['INT4' => 1, 'CHAR4' => 'NOPE'],
        ]
    ]);

    var_dump($result);
} catch(\SAPNWRFC\ExceptionInterface $ex) {
    // do something
}

issue when bapi change, feilds(key and value) does'nt map

When the bapi TABLE column format change the response array doesnt map with respective fields unless WEBSERVER is restarted.

I am using IIS server and php 7.0.21
x64.

When i restart the iis server the data(value) maps with respective fields(Key).

Kindly advise.

Change invoke rtrim to false as default

I think we should change rtrim option to false by default. It breaks compatibility with older versions and I think it will affect many users. It already affects all my applications.

Building with SAP NW RFC SDK < 7.20

Hi,
I tried make a library for PHP 7.1 and got a error.
I tried this in two different Systems:

  1. PHP 7.1.10-1+020170929170818.9+stretch1.gbp501135 (cli) (built: Sep 29 2017 17:08:20)
    OS:
    Linux c026bfe236a2 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 GNU/Linux

Distributor ID: Debian
Description: Debian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

2)PHP 7.1.10-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Sep 29 2017 17:04:25)
OS:
Linux ubuntu 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Error:
/usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c: In function 'zim_Connection_getAttributes': /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:377:121: error: 'RFC_ATTRIBUTES {aka struct _RFC_ATTRIBUTES}' has no member named 'partnerBytesPerChar' add_assoc_str(return_value, "partnerBytesPerChar", sapuc_to_zend_string(attributes.partnerBytesPerChar)); ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:378:125: error: 'RFC_ATTRIBUTES {aka struct _RFC_ATTRIBUTES}' has no member named 'partnerSystemCodepage'; did you mean 'partnerCodepage'? add_assoc_str(return_value, "partnerSystemCodepage", sapuc_to_zend_string(attributes.partnerSystemCodepage)); ^ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c: In function 'zim_Connection_setTraceDir': /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:548:10: warning: implicit declaration of function 'RfcSetTraceDir' [-Wimplicit-function-declaration] rc = RfcSetTraceDir((path_u = zend_string_to_sapuc(path)), &error_info); ^~~~~~~~~~~~~~ /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c: In function 'zim_Connection_setTraceLevel': /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:578:10: warning: implicit declaration of function 'RfcSetTraceLevel' [-Wimplicit-function-declaration] rc = RfcSetTraceLevel(NULL, NULL, level, &error_info); ^~~~~~~~~~~~~~~~ In file included from /usr/sap/nwrfcsdk/include/sapnwrfc.h:9:0, from /usr/sap/nwrfcsdk/php7-sapnwrfc/exceptions.h:10, from /usr/sap/nwrfcsdk/php7-sapnwrfc/sapnwrfc.c:21: At top level: /usr/sap/nwrfcsdk/include/sapuc.h:840:24: warning: 'sccsidU16' defined but not used [-Wunused-variable] static const SAP_UC* sccsidU16 = NULL; ^~~~~~~~~ Makefile:194: recipe for target 'sapnwrfc.lo' failed make: *** [sapnwrfc.lo] Error 1

Publish on PECL

Since this extension is well tested and many people need SAP access, i think the visibility of this project needs to be better.

Most people will search for extensions over pecl, so i think this would be a good place to list this extension
https://pecl.php.net/account-request.php

Currently you can only find it, if you directly search it on github or google around a while

When SAP return a big array, error happen.

Hello sir!
I meet a problem when submit a form.
we have a sales report in SAP, which have many selection options. if we input more condition, we'll get less result,else we'll get huge result. In SAP, everything works fine. But when I submit a form with very less selection condition(ex. S_month: 01 - 10), error happen like this:

Stack trace:
#0 /php/wwwroot/others/saperp/index/zsap_zfir010.php(69): SAPNWRFC\RemoteFunction->invoke(Array)
#1 {main} thrown in /php/wwwroot/others/saperp/index/zsap_zfir010.php on line 69```

is the rfc interface has limite?

could you help, thanks!

PHP <-> SAP Write Values

Hi,

at first I would like to thank you for your work. The code works great. The reason why I'm posting an issue is that I'm not sure if my problem is related to your SAP wrapper or if it's a conceptual problem.

The problem I have is that I cannot write to SAP. It seems that all parameters (user credentials, permission, etc.) are set correct. I also can use the ping-test and some other functions that return data from SAP.
What I can't do is writing data from PHP to SAP.

So maybe you can wrote an additional Unit-Test that demonstrates the usage of a "writing" function. Bases on that test I can start investigating the problem in a deeper way.

Thank you for your help

Raphael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.