on 05-05-2009 9:26 AM
hi,
i am newbie trying to write my own php script to call function.
unfortunately i am unable to pass the inputs to structure using saprfc_import..
here is what i have done
$login = array ("ASHOST"=>"server",
"SYSNR"=>"00",
"CLIENT"=>"600",
"USER"=>"user",
"PASSWD"=>"password",
"LANG"=>"EN",
"CODEPAGE"=>"1100");
$rfc = saprfc_open ($login );
if (! $rfc )
{
die("RFC connection failed with error:".saprfc_error());
}
//Discover interface for function module ZRP_MULDCB_MULTI
$fce = saprfc_function_discover($rfc,"ZRP_MULDCB_MULTI");
if (! $fce )
{
echo "Discovering interface of function module failed";
exit;
}
saprfc_import($fce,"BSHEADER", array( "PLANT"=>"$plant","KUNNR"=>"$kunnr","PDATE"=>"$pdate",
"GLOCK"=>"$glock","PTLOCK"=>"$ptlock","PDLOCK"=>"$pdlock",
"SLVLOCK"=>"$slvlock","BRZLOCK"=>"$brzlock","LIFNR"=>"$lifnr"));
//Fill internal tables
saprfc_table_init ($fce,"BOFNDG");
saprfc_table_init ($fce,"BOLABOUR");
saprfc_table_init ($fce,"BOMETAL");
saprfc_table_init ($fce,"BOSETT");
saprfc_table_init ($fce,"BOSTONE");
saprfc_table_init ($fce,"BOTOLER");
saprfc_table_init ($fce,"BOUNIT");
saprfc_table_init ($fce,"BRETURN");
saprfc_table_init ($fce,"BSMATNR");
saprfc_table_append ($fce,"BSMATNR",array("MATNR"=>"$matnr","CALBOM"=>"$calbom"));
saprfc_table_init ($fce,"RETURN");
$rfc_rc = saprfc_call_and_receive ($fce);
On execution the result is zero. i think the problem lies in passing the import values to BSHEADER structure..possibly i have bungled. please help..
regards
Vic
Just try to change
saprfc_table_append ($fce,"BSMATNR",array("MATNR"=>"$matnr","CALBOM"=>"$calbom"));
with
saprfc_import ($fce,"BSMATNR",array("MATNR"=>"$matnr","CALBOM"=>"$calbom"));
Greetings,
Blag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discovered the problem area. the $matnr variable input is formatted to the required MATNR field. but on execution results in this ..
RFC Error Info : Key : RFC_IO10 Status : CODE=CM_DEALLOCATED_NORMAL STATUS=CM_NO_STATUS_RECEIVED DATA=CM_COMPLETE_DATA_RECEIVED ID=91649030 Message : Internal: IO HANDLE=7 DRV=EXT LINE=1218 CODE=10 : GET ID=ffff LINE=1041 CODE=3
Exception raised: SYSTEM_FAILURE
anybody have info on what this error means? please help..
Vic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi blag,
I tried replacing saprfc_table_append with saprfc_import but still no joy, instead now i get..
"Warning: CALDBG: Can't find interface name BSMATNR, __cal_set()"
the saprfc_table_append worked fine earlier. its just the saprfc_import.
it simply isnt passing any value to the 'BSHEADER' structure. i even tried hard coding the values instead of using variables, with zero result.
Thank you for the response, your blogs have been most enlightening.
Any insight into solving this problem would be most helpful, its driving me nuts..
regards
Vic
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.