Comments (9)
The error messages are indeed not ideal, I'll have a look at improving them. Most of them already state the parameter name when an error occurs, but some of the TABLE methods do not currently.
The RFC_ILLEGAL_STATE
return code in RfcDestroyFunctionDesc
should not be an issue. There's definitely a problem worth investigating there, but I think your problem lies somewhere else.
I'll have a look at the BAPI. I'm using it in one of my projects, so I should find a clue...
from php7-sapnwrfc.
Can you upload the full trace somewhere (make sure to wipe credentials and the like)?
from php7-sapnwrfc.
You bet - thanks much for the help. Here you go.
rfc09564_09388.salesorder.usb.failed.txt
from php7-sapnwrfc.
Actually, I can't reproduce your error. Using this code:
<?php
$config = include "tests/sapnwrfc.config.inc";
$c = new \SAPNWRFC\Connection($config);
$f = $c->getFunction('BAPI_SALESORDER_CREATEFROMDAT2');
$r = $f->invoke([
'ORDER_HEADER_IN' => [
'DOC_TYPE' => 'Y0OR',
'SALES_ORG' => '3310',
'DISTR_CHAN' => '00',
'DIVISION' => '00',
'PURCH_NO_C' => '',
'COLLECT_NO' => '',
],
'ORDER_PARTNERS' => [
[
'PARTN_ROLE' => 'AG',
'PARTN_NUMB' => '0020040938',
]
],
'ORDER_ITEMS_IN' => [
[
'ITM_NUMBER' => '00010',
'MATERIAL' => 'BC535R',
],
[
'ITM_NUMBER' => '00020',
'MATERIAL' => 'B0020017',
],
[
'ITM_NUMBER' => '00030',
'MATERIAL' => 'B0020017',
]
],
'ORDER_CONDITIONS_IN' => [
[
'ITM_NUMBER' => '00020',
'COND_TYPE' => 'Y0M1',
'COND_VALUE' => 11.111,
]
],
'ORDER_TEXT' => [
[
'TEXT_ID' => '004',
'LANGU' => 'EN',
'FORMAT_COL' =>'*',
'TEXT_LINE' => '',
]
],
'ORDER_SCHEDULES_IN' => [
[
'ITM_NUMBER' => '00010',
'REQ_QTY' => 1.0,
],
[
'ITM_NUMBER' => '00020',
'REQ_QTY' => 2.0
],
[
'ITM_NUMBER' => '00030',
'REQ_QTY' => 1.0
]
]
]);
var_dump($r);
I only get errors about the sales document not existing, etc. (which was expected), but the source line that produces the error you mentioned executes cleanly.
I'll poke around a little more though. Can you show me a code snippet that reliably reproduces the error for you?
from php7-sapnwrfc.
Thanks I'll try your code snippet in the morning and get back to you. Best,
from php7-sapnwrfc.
I updated the exception messages to be more clear.
Consider this code, passing a wrong parameter type to ORDER_PARTNERS
:
// [...]
$r = $f->invoke([
// [...]
'ORDER_PARTNERS' => [
// ORDER_PARTNERS is a table, but we are not passing rows here
'PARTN_ROLE' => 'AG',
'PARTN_NUMB' => '0020040938',
],
// [...]
]);
// [...]
Instead of only
Failed to set TABLE row, expected array
the message is now
Failed to set TABLE row, expected array for parameter ORDER_PARTNERS
I'll release a new version in the next days, so @ThaDafinser can (hopefully?) provide new builds for Windows.
from php7-sapnwrfc.
Thanks so much for your help. We FINALLY figured out the issue, and your example code was instrumental in doing so. Please see below -- when the header contains a reference this triggers the "Failed to set TABLE row, expected array". We were using a reference within our code to simplify some of our logic : ). When we remove the reference... boom.... it works great : )
The following minor adjustment to your code triggers the error:
from php7-sapnwrfc.
Happy to hear it works.
I'll definitely have a look at why it doesn't work with references though. I rarely use them, so there are no test using references that could have caught this issue. I'll open another ticket to track progress...
from php7-sapnwrfc.
So the problem with this is that you have to define an array, but watch out how you define it
This will not work because the array does not have an index.
$customersData = [ 'LOW' => $sap->populateKunnrWithZeros($customer->kunnr), 'HIGH' => $sap->populateKunnrWithZeros($customer->kunnr) ];
This will work because the array has an index.
$customersData[0] = [ 'LOW' => $sap->populateKunnrWithZeros($customer->kunnr), 'HIGH' => $sap->populateKunnrWithZeros($customer->kunnr) ];
from php7-sapnwrfc.
Related Issues (20)
- Unable to add extenstion PHP7 SAP NW RFC HOT 1
- Where tofind SYSNR
- Scripts works only executed on CLI HOT 1
- Solution: Docker with build for PHP 8.2
- SAP NWRFC is not a valid win32 version HOT 1
- Error during Make HOT 7
- Can't do two calls HOT 2
- Warning Library HOT 2
- PHP Fatal error: Possible integer overflow in memory allocation (1610760192 32 + 32) HOT 2
- Pre-build for 8.2.4 HOT 1
- Extension got disappeared after somedays HOT 1
- PHP Startup: Unable to load dynamic library php_sapnwrfc.dll HOT 3
- PHP 7.2 + SAP NW RFC 7.20 +php7-sapnwrfc 1.3.0 return parameter is empty HOT 2
- Memory Leak Issue in SAP PHP Connection: Seeking Advice on Workaround HOT 15
- Error building PHP Version: 8.3.3 with sap nw rfc 7.5 patch 12 HOT 2
- Update Windows build instructions HOT 1
- please release php_sapnwrfc.dll for PHP 8.3.8 HOT 1
- Connect to a message server (Load Balancing) HOT 4
- Error when compile with PHP 8.3.9 HOT 3
- install php_sapnwrfc on windows using php 8.3.10 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php7-sapnwrfc.