cancel
Showing results for 
Search instead for 
Did you mean: 

saprfc_import question

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

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.

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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