on 02-09-2012 8:07 AM
Hello developers,
first of all its good to see that a PHP-SAP development still lives! And now to my question:
we have a certain function module that is being called from an third party application. For our development needs we need to see the raw data coming from the RFC call so I went back to roots, installed apache, php and so on. Now, the hello world (SE16 emulator) works fine, I got the data from tables. However adopting the script to my function return:
Warning: CALDBG: Can't find interface name ZDATA, __cal_refresh_internal_buffer() in ...SAP_Connection.php on line 61
line 61:
saprfc_table_init ($fce,"ZDATA");
The function module I call is defined like this:
FUNCTION Z_PROD_DATA.
*"----------------------------------------------------------------------
*"*"Lokální rozhraní:
*" IMPORTING
*" VALUE(S_FBUDA_FROM) TYPE FBUDA OPTIONAL
*" VALUE(S_FBUDA_TO) TYPE FBUDA OPTIONAL
*" VALUE(S_AESZN) TYPE AESZN OPTIONAL
*" TABLES
*" ZDATA TYPE Z_PDATA
*"----------------------------------------------------------------------
tables: vbrp, vbpa, konv, vbfa.
data: begin of ivbrp occurs 0 ,
and the relevant part of the php script looks like this:
//Try to connect to SAP using our Login array
$rfc = saprfc_open ($LOGIN);
IF (! $rfc )
{
ECHO "The RFC connection has failed with the following error:".saprfc_error();
EXIT;
}
//We must know if the function really exists
$fce = saprfc_function_discover($rfc, "Z_PROD_DATA");
IF (! $fce )
{
ECHO "The function module has failed.";
ECHO $rfc;
EXIT;
}
var_dump($fce);
//Pass import parameters
saprfc_import ($fce,"S_FBUDA_FROM",$_POST['S_FBUDA_FROM']);
saprfc_import ($fce,"S_FBUDA_TO",$_POST['S_FBUDA_TO']);
saprfc_import ($fce,"S_AESZN",$_POST['S_AESZN']);
//Pass table parameters
// saprfc_table_init ($fce,"OPTIONS");
// saprfc_table_init ($fce,"FIELDS");
saprfc_table_init ($fce,"ZDATA");
ending with the above mentioned line 61.
I cant use webservices for this. Any ideas what I am doing wrong?
Thank you
Hi Peter,
Just wondering about the way the table ZDATA has been declared: I would expect the following:
FUNCTION Z_PROD_DATA .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(S_FBUDA_FROM) TYPE FBUDA
*" VALUE(S_FBUDA_TO) TYPE FBUDA
*" VALUE(S_AESZN) TYPE AESZN
*" TABLES
*" ZDATA STRUCTURE Z_PDATA
*"----------------------------------------------------------------------
Maybe this could be of some help.
Thank you and bye,
Flavio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.