简体   繁体   中英

search in sap using sap_rfc

I am using http://saprfc.sourceforge.net/ to connect to SAP and get results.

$fce = saprfc_function_discover($rfc,"ZBAPI_CUSTOMER");
$customerSAP="0000000000539";
$customerSAP=substr($customerSAP,-10);
$IMPORTT = array ("ZCUSTOMER" => $customerSAP );
saprfc_import ($fce,"CUSTOMERNO",$customerSAP);
saprfc_table_init ($fce,"ZBAPICUSTOMER");
saprfc_exception()
$rfc_rc = saprfc_call_and_receive ($fce);
saprfc_function_debug_info($fce);
saprfc_function_free($fce);
saprfc_close($rfc); 

This searches for only one customer.

Is there a way to make a search for a couple of customers using only http://saprfc.sourceforge.net/ and without creating a new connection?

This is not a question of the library you use to make the call, but rather of the function module you call. From the name ZBAPI_CUSTOMER I can see that it's a custom module, and that is about it. What it can do - that is, whether it can retrieve multiple customers - cannot be deduced from this. Contact your SAP department, they will most certainly be able to tell you more about this.

The logic of the BAPI may not support providing more than one customer record as an input. It looks like this custom BAPI may require a structure of data for the read action. If however the input type is a table then you could provide more than one record in the call. You would need to understand what the characterictics are of this custom BAPI the Z prefix indicates it is custom.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM