Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PHP API for ABAP Web Service

Former Member
0 Likes
15,841

I need to make soap request from PHP application to SAP. Below is my call:

<?php

require_once('sap_server.php');

try{

    $client = new SoapClient('ZWS_ZBAPI_CCC_PRICING.wsdl', array(

            'trace' => 1,

            'exceptions' => true,

            'cache_wsdl' => WSDL_CACHE_NONE,

            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,

            'login' => "username",

            'password' => "password",

            )

    );

   

    $client->ZbapiCccPricing(

        new SoapVar(array(

                'Checkdata' => 'Y',

                'ExCond' => null,

                'ExVbap' => null,

                'GetParinfo' => 'N',

                'Materials' => '78101101273',

                'Noofrecords' => null,

                'OnlyNzeroCond' => null,

                'OrderType' => 'ZOR',

                'Parinfo' => null,

                'Partners' => null,

                'Partnertype' => null,

                'Pricingmsgs' => null,

                'Sarea' => '12101010',

                'SortByCond' => 'Y')

       , XSD_ANYTYPE, "ZbapiCccPricing")

    );

    echo "REQUEST:\n" . htmlentities($client->__getLastRequest()) . "\n";

    echo "REQUEST:\n" . htmlentities($client->__getLastRequestHeaders()) . "\n";

    echo "RESPONSE:<pre>" . htmlentities($client->__getLastResponse()) . "</pre>";

    echo "RESPONSE:<pre>" . htmlentities($client->__getLastResponseHeaders()) . "</pre>";

} catch (Exception $e) {

   echo $e->getMessage();

}

 

?>

I'm stuck with the input parameters. SAP expects to get this request:

<ns2:ZbapiCccPricing xmlns:ns2='urn:sap-com:document:sap:soap:functions:mc-style'>

<Checkdata>Y</Checkdata>

<ExCond></ExCond>

<GetParinfo>N</GetParinfo>

<Materials>

    <item><Material>78101101273</Material>

    <Orderqty>10</Orderqty></item>

</Materials>

<Noofrecords>0</Noofrecords>

<OnlyNzeroCond>Y</OnlyNzeroCond>

<OrderType>ZOR</OrderType>

<Partners>

    <item><Parvw>WE</Parvw><Parnr>0000300046</Parnr></item>

</Partners>

<Pricingmsgs></Pricingmsgs>

<Sarea>

    <Vkorg>1210</Vkorg>

    <Vtweg>10</Vtweg>

    <Spart>10</Spart>

</Sarea>

<SortByCond>Y</SortByCond>

</ns2:ZbapiCccPricing>

But I have no idea how to input these parameters into PHP SoapClient. Can anyone help? I am new to SOAP and SAP.

Thank you.

5 REPLIES 5
Read only

Former Member
0 Likes
15,112

Have you used the Scripting Tool? See the attached link for details on PHP SOAP and a link to the Scripting Tool.

http://scn.sap.com/people/frederic-pascal.ahring/blog/2007/02/14/developing-composite-applications-w...

Read only

0 Likes
15,112

I've seen that page before. The problem is I can only download the Scripting Languages Tool Preview 2 which works on the old version of Eclipse (2.1). The Scripting Languages Tool Preview 3 is not downloadable (at least there is no link, as far as I can tell).

How can I download the Scripting Languages Tool Preview 3?

Thanks in advance.

Read only

0 Likes
15,112

I tried to install the Scripting Languages Tool Preview 2 on Eclipse for PHP Developers Version: 3.0.2, but I got this error:

Cannot complete the install because of a conflicting dependency.

  Software being installed: Eclipse Modeling Framework (EMF) 2.1.2 (org.eclipse.emf.feature.group 2.1.2)

  Software currently installed: Eclipse for PHP Developers 3.0.2.v20120611144 (org.zend.php.product 3.0.2.v20120611144)

  Only one of the following can be installed at once:

    EMF Edit 2.7.2.v20120130-0943 (org.eclipse.emf.edit 2.7.2.v20120130-0943)

    org.eclipse.emf.edit 2.1.1

  Cannot satisfy dependency:

    From: EMF Edit 2.7.2.v20120130-0943 (org.eclipse.emf.edit.feature.group 2.7.2.v20120130-0943)

    To: org.eclipse.emf.edit [2.7.2.v20120130-0943]

  Cannot satisfy dependency:

    From: Eclipse Modeling Framework (EMF) 2.1.2 (org.eclipse.emf.feature.group 2.1.2)

    To: org.eclipse.emf.edit [2.1.1]

  Cannot satisfy dependency:

    From: Eclipse for PHP Developers Feature 3.0.2.201206111411 (org.zend.php.feature.feature.group 3.0.2.201206111411)

    To: org.eclipse.emf.edit.feature.group 0.0.0

  Cannot satisfy dependency:

    From: Eclipse for PHP Developers 3.0.2.v20120611144 (org.zend.php.product 3.0.2.v20120611144)

    To: org.zend.php.feature.feature.group [3.0.2.201206111411]

Read only

0 Likes
15,112

No idea where to get the version 3, I haven't used it myself nor do I know if it is still being maintained. Maybe can comment?

Read only

0 Likes
15,112

I believe that you will have more help in The space isn't too active but at least back in the days the best experts on the topic used to hang out in there.