【问题标题】:PHP SAP RFC Function call not workingPHP SAP RFC 函数调用不起作用
【发布时间】:2023-03-19 21:53:01
【问题描述】:

这是我第一次使用 PHP 调用 SAP 函数。遇到了这个问题,直到有经验的人帮助我才能解决。

<?php

 // saprfc-class-library   

 require_once("saprfc.php");

 // Create saprfc-instance

  $sap = new saprfc(array(

                        "logindata"=>array(

                        "ASHOST"=>""        // application server

                        ,"SYSNR"=>""                // system number

                        ,"CLIENT"=>""            // client

                        ,"USER"=>""            // user

                        ,"PASSWD"=>""        // password

                        )

                    ,"show_errors"=>false            // let class printout errors

                    ,"debug"=>true)) ;                 // detailed debugging information



  // Call-Function

  $result=$sap->callFunction("ZBAPI",

            array(     array("IMPORT","FROM_","100"),

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

                                    array("TABLE","Namesdata",array())

                            ));                                



       if ($sap->getStatus() == SAPRFC_OK) {

    // Yes, print out the Userlist

    ?><table>

        <?php

                //$sap->printStatus();

                 foreach ($result["Namesdata"] as $orders) {





                      echo "<tr><td>", $orders["name"],"</td><td>",$orders["form"],"</td> <td>",$orders["Names"],"</td></tr>";

                 }



              ?></table><?php

             } else {

              $sap->printStatus();



              }

               $sap->logoff();

              ?> 

这段代码有一些像这样的错误

saprfc::callFunction('ZBAPI')

Import-Parameter=FROM_ 无法设置。 (存在吗?)

但我评论导入参数意味着它从 saprfc 获取数据在这段代码中有什么问题..

【问题讨论】:

  • 请发布您正在调用的功能模块(ZBAPI)的详细信息,特别是它的参数。我猜它没有参数FROM_...
  • 函数名是 ZBAPIWERk
  • 参数是 FROM_WERK

标签: php sap saprfc


【解决方案1】:

像这样导入值 --- array("IMPORT","name",array("fieldname"=>"1000"))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-04-16
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    • 2012-04-12
    • 1970-01-01
    • 2023-04-02
    相关资源
    最近更新 更多