cancel
Showing results for 
Search instead for 
Did you mean: 

PHP and BAPI_CUSTOMER_CREATEFROMDATA1 problem

Former Member
0 Kudos

Hi guys,

I am having difficulties creating customers via BAPI_CUSTOMER_CREATEFROMDATA1, the function is working without problems in SE37 but not via RFC.

I keep getting the following error.

Errors found during saprfc-Calls:


saprfc::callFunction('BAPI_CUSTOMER_CREATEFROMDATA1')
Import-Parameter=PI_PERSONALDATA could not be set. (Does it exist?)

My parameters are.

$personal_data['PI_PERSONALDATA'] = array(

    'FIRSTNAME'     =>  'ZSOLDOS',

    'LASTNAME'      =>  'SZABOLCS TEST',

    'DATE_BIRTH'    =>  '26.05.1987',

    'CITY'          =>  'WEBSERVICE LAND',

    'STREET'        =>  'DECEBAL 20/6',

    'COUNTRY'       =>  'RO',

    'COUNTRYISO'    =>  'RO',

    'REGION'        =>  'MS',

    'TEL1_NUMBER'   =>  '0751380275',

    'E_MAIL'        =>  'szabi@bysobi.com',

    'LANGU_P'       =>  'RO',

    'LANGUP_ISO'    =>  'RO',

    'CURRENCY'      =>  'RO'

);

$personal_data['PI_COPYREFERENCE'] = array(

    'SALESORG'      =>  'BYSO',

    'DISTR_CHAN'    =>  '01',

    'DIVISION'      =>  '01',

    'REF_CUSTMR'    =>  '600102'

);

$result = $b2c->sapConnection()->callFunction("BAPI_CUSTOMER_CREATEFROMDATA1",

    array(

        array("IMPORT","PI_PERSONALDATA",$personal_data['PI_PERSONALDATA']),

        array("IMPORT","PI_COPYREFERENCE",$personal_data['PI_COPYREFERENCE'])

    )

);

$result_commit = $b2c->sapConnection()->callFunction("BAPI_TRANSACTION_COMMIT",

         array(

            array("IMPORT","WAIT", ""),

            array("EXPORT","RETURN", array()),

         ));

if($b2c->sapConnection()->getStatus() == SAPRFC_OK) {

    print_r($result);

} else {

    echo 'nope';

}

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Szabi,

You may want to check the this link out: http://saprfc.sourceforge.net/src/saprfc.html

Best Regards,

Justin

Former Member
0 Kudos

Hi Justin,

Thank you for the documentation but my problem is that the parameter is not recognized by the RFC call.

On the other hand I've made many Z function implementation via PHP, but this standard BAPI seems not to work