Business One PHP access

Hi,
I'm trying to access SBO with PHP
Connecting to the company object is working fine
But the next step (getbusinessobject) is not working
Does anybody have tips ?
This is the current code :
<?php
echo "SBO PHP TEST<br>";
$vCmp=new COM("SAPbobsCOM.company") or die ("No connection");
$vCmp->server = "(local)";
$vCmp->CompanyDB = "sbodemo_dutch";
$vCmp->username = "manager";
$vCmp->password = "manager";
//$vCmp->language = "ln_English";
//$vCmp->UseTrusted = True;
$lRetCode = $vCmp->Connect;
echo $vCmp->CompanyName;
echo '<br>';
$vItem = $vCmp->GetBusinessObject(oItems);
$RetVal = $vItem->GetByKey("A1010");
echo '$vItem->Itemname';
echo '<br><br>Ready';
?>

Hi,
Thanks a lot for this post.
For me the following is running
$oItem=$vCmp->GetBusinessObject(4);
$RetBool=$oItem->GetByKey("A1010");
echo "<br>". $RetBoll;
echo "<br>". $oItem->ItemName;
This return:
1
Nom de l'article
For recordset
$oRS=$vCmp->GetBusinessObject(300);
$oRS->DoQuery("Select Top 10 itemcode,itemName from oitm")
$oRS->MoveFirst
while ($oRS->EOF!=1){
     echo "<BR>".$oRS->Fields->Item(0)->value." ".$oRS->Fields->Item(1)->value;
     $oRS->MoveNext;
To add an order
$oOrder=$vCmp->GetBusinessObject(17);
$oOrder->CardCode="C01";
$oOrder->DocDueDate="06/04/2009";
$oOrder->Lines->Itemcode="A1010";
$oOrder->Quantity=100;
$RetCode=$oOrder->Add;
$Nk="";
if ($RetCode==0)  {
     $vCmp->GetNewObjectCode($Nk);
     echo "<BR>" ."Doc Entry ".$vCmp->GetNewObjectCode($Nk);
Christophe

Similar Messages

  • SAP Business One PHP Connectivity

    Hi,
    When I use this code, I get the return code as -111. Please let me know where I can be going wrong.
    <?php
    $vCmp=new COM("SAPbobsCOM.company") or die ("No connection");
    $vCmp->server = "(local)";
    $vCmp->CompanyDB = "sbodemo_US";
    $vCmp->username = "manager";
    $vCmp->password = "manager";
    $lRetCode = $vCmp->Connect;
    echo " The success code is " .$lRetCode.
    ?>
    Thanks for your help.

    Hi Verma,
    Welcome to the Forum
    Try This......
    ' In Vb.net
    Dim ocompany As New SAPbobsCOM.Company
            ocompany.DbServerType = BoDataServerTypes.dst_MSSQL2008
            ocompany.Server = "servername"
            ocompany.UseTrusted = False
            ocompany.DbUserName = "sa"
            ocompany.DbPassword = "sa password"
            ocompany.CompanyDB = "SBODemoIN"
            ocompany.UserName = "manager"
            ocompany.Password = "manager"
            lretcode = ocompany.Connect
            If lretcode <> 0 Then
                ocompany.GetLastError(lerrcode, serrmsg)
                MessageBox.Show(serrmsg)
            End If
            MessageBox.Show("connected successfully")
    -111 means Invalid Memory Access
    Thanks
    Shafi

  • Business One and Open Source Web Front-Ends, PHP etc.

    Hi there,
    I am a complete newbie to all things SAP, so please excuse my ignorance.
    I am trying to implement a solution for SAP Business One, including a web front-end for queries and information. The  SAP backend is running on a SQL Server, Windows 2000.
    The catch is, I won't be running the web front-end off a Windows server. I need to find a solution for an Apache server, running (probably) PHP but could be JSP or any other scripting language to access SAP - but it will be running on a separate server, non-windows.
    I have been given examples of people getting access to the DI Server using PHP, but it all involves a call to a COM() function that won't run from anything except a Windows server.
    How can I acheive the same result running a PHP page from an OpenBSD or Linux / Apache server? Is the DI Server the right thing to be looking at, or am I going in completely the wrong direction?
    Any help would be appreciated.
    Thanks,
    Nick.

    post your question in SAP Business One SDK for better response.
    Regards
    Raja

  • Business-One-Auswertungen mit MS-Access oder MS-Excel Pivot-Table

    Guten Morgen,
    ich habe eine Frage zu den Auswertungsmöglichkeiten im SAP Business One.
    Mir wurde bisher XL-Reporter, Coresuite und Crystal genannt.
    Gibt es Wege und auch Erfahrungen, Daten per MS-Access oder MS-Excel über Pivot "zu holen" und aufzubereiten.
    Ich habe bereits einen Beitrag hier im Forum diesbezüglich gefunden, jedoch ist der recht ungenau.
    Hier ist leider nicht die Vorgehensweise beschrieben, welche Datenquelle und Werkzeuge zu nutzen sind.
    Kannn jemand weiterhelfen ?
    Vielen Dank im voraus.
    Gruß
    Markus

    Hallo Markus,
    prinzipiell gibt es verschiedene Wege. Einer ist via Addons - wir selbst nutzen Coresuite -.
    Die anderen Wege sind :
    1. Du erstellst dir eine Abfrage und exportierst dir anschließend die Daten via Excel Button in eine Tab Datei. Auf dauer recht mühsam wie ich finde.
    2. Du benutzt ODBC um in Office Produkte externe Datenquelle - hier die SAP DB - einzubinden. Dazu solltest du am SQL Server einen neuen Benutzer mit ausschließlichem Lesezugriff auf die SAP DB erstellen. Schreibender Zugriff grade durch Programme wie Access ist tödlich.
    Anschließend erstellt du unter Systemsteuerung - ODBC Datenquelle eine neue Verbindung zur SQL Datenbank mit Hilfe deines Read only Benutzers. Diese Verbindung kannst du anschließend in Excel unter Extras - Externe Datenquellen benutzen und Tabellen aus der SAP DB auslesen und zb in Pivot einbetten.
    Grüße Steffen

  • Creation of Add-on package for 64 bit and 32 bit SAP Business One Client

    Please help me creating package for 64 bit and 32 bit SAP Business One. If Add-on executable is compiled with x86 option then there is no issue of connecting Add-on with 32 bit SAP Business one and if Add-on executable is compiled with Any CPU option then there is no issue of connecting Add-on with 64 bit SAP Business one. Problems are mentioned as below
    1. My Add-on uses MS ACCESS connection and the connection is read using Jet OLEDB 4.0 provider. It works fine for x86 compile mode but not when compile mode is Any CPU. I searched for the issue on Google and found a solution to change MS ACCESS connection provider to ACE.OLEDB.12.0 but again ACE provider is installed according to the Office version i.e. 32 bit or 64 bit office suite. If I install 32 bit ACE provider then Add-on executable compiled with x86 version is working fine but with Any CPU option throws error as provider is not registered on current machine.
    2. Secodly, our license validation activex dll is build using vb 6.0 and therefore when Add-on executable is compiled using Any CPU option, Add-on EXE cannot read from license dll. Any suggestion, how the activeX dll can be compiled whose component can be created from for X86 compiled exe and any cpu compiled exe.
    Please help because we are stuck in this issue and cannot move forward.
    Thanks.

    Hi Alejandro,
    That is one solution but did your add on used ms access connection? if you used Jet oledb to connection string or ace oledb connection string? what if 32 bit office is installed and what if 64 office is installed? how did you found the office version in install script? after determining the office version how did you installed Microsoft redistributable for ace oledb (32 bit or 64 bi )?
    I am sorry that I asked many questions but these are the problems where I am stuck with the addon installer?
    Thanks

  • Addon not loading - B1 Usability Package for all users in SAP Business One

    Hello, I am a new admin to SAP B1 and am about to go live in a few weeks. We are running SAP Business One v. 8.80.227.
    Envirorment details: Dedicated server for SAP database, and Terminal Server for remote connections.
    I have a demo group of users in Active Directory that have permission to Remote Desktop to the TS and load SAP. For now, theses users are local admins on the TS. ( Permissions to be revised once addon issues are worked out ). I am the companies tech, and we have a SAP implementation company leading the project development.
    Currently the addons that we are running are CRSB1Addon SAP 8.8 and B1UP from boyumit.
    For one of the users in the Active Directory Security Group all the addon's work great. However the other users get the error below;
    When logging in the system message window shows the following:
    Failed to assign SAP Business One user license to SAP Add-ons. The Add on is configured to automatically load on startup, yet once I get the error, I open the Add on Manager and I don't see the B1UP in either tab at all.
    The error on the TS in the log is here:
    Log Name:      Application
    Source:        Application Error
    Date:          18/03/2010 10:55:25 AM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      OVCL-TS.laurieroptical.local
    Description:
    Faulting application SAP Business One.exe, version 8.80.227.0, time stamp 0x4b8fadd4, faulting module ole32.dll, version 6.0.6002.18005, time stamp 0x49e037d7, exception code 0xc0000005, fault offset 0x000472da, process id 0x1f14, application start time 0x01cac6a4a2da01c9.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2010-03-18T14:55:25.000Z" />
        <EventRecordID>3778</EventRecordID>
        <Channel>Application</Channel>
        <Computer>OVCL-TS.laurieroptical.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>SAP Business One.exe</Data>
        <Data>8.80.227.0</Data>
        <Data>4b8fadd4</Data>
        <Data>ole32.dll</Data>
        <Data>6.0.6002.18005</Data>
        <Data>49e037d7</Data>
        <Data>c0000005</Data>
        <Data>000472da</Data>
        <Data>1f14</Data>
        <Data>01cac6a4a2da01c9</Data>
      </EventData>
    </Event>
    Any comments would be greatly appreciated.
    Thanks
    Edited by: dontforgetken on Mar 18, 2010 4:05 PM

    hello Ken - Boyum IT has its own License Administration - path of Administration > Add Ons > B1 Usability Package > License Administration...
    Do all of the users have a checkmark to give them access???
    When a user has only the Main Menu window open, select the "Form Settings" icon and follow the same path on the Form Settings window that is diplayed and make sure they have checkmarks next to the B1 Usability Package to be "Visible".
    Are all of the user set to display Boyum IT on their machines???
    LOL - I am not technical so I have no idea what that other stuff means...
    Hope that helps...
    Zal

  • Creating New Dashboard Packages for SAP Business One

    Hi Experts,
         I am learning how to create my dashboard for Business One on version 9.1PL04.
         In this step.
    http://businessone91:8080/B1iXcellerator/exec/ipo/vP.001sap0004.in_HCSX/com.sap.b1i.vplatform.runtime/INB_HT_CALL_SYNC_X…
            The URL can't returns an XML data sucessfully.So, i try to through IE browser to access this URL.
    SAP B1iP detected an error:
    Emitted HTTP-Code:
    500 - Internal Server Error
    Internal Reason:
    Server side cannot respond your request (No scenario step (vBIU) assigned for step for sender system (SysId) [0009] [incoming identifier = 'io'])
    Recommendation:
    Check for the correctness of your activity or environment or ask your system-administrator for further help.
    tid
    TID: 15031009242239306682A9FEA29322F6
    Full Internal Error Message:
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception:
    com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.utilities.UtilException: UTE001 Nested exception: com.sap.engine.lib.xml.util.NestedException: Server side cannot respond your request (No scenario step (vBIU) assigned for step for sender system (SysId) [0009] [incoming identifier = 'io'])
    Log-ID:
    LID15031009242239306858A9FEA2931BD0
        How can i slove this problem?Thanks for your help.

    Hi David,
    I also seek help for the dashboards, no doubt its matter of practise but like we are facing the problems where we have to map our query structure with Excel sheet.
    like I'm facing a problem where my Query accepts two parameters in SAP B1.
    In Xcelsius I mapped almost everything and these two parameters are accumulated by 2 combo's but when I make a XML data connection and use trigger cell option , it just takes one combo into consideration.
    Expected result is : If I change the value in any of the combo then it shud reflect results accrodingly
    Actual result : if I change the value of 2nd combo it doesn't reflect the changes until I select the value from first combo again.
    Any inputs will be really very much appreciated.
    Regards

  • Crystal Reports background processing for SAP Business One 8.8

    Dear Partners,
    I have an SDK program developed in SAP Business One SDK that works in 2007, it calls crystal reports externally and can be executed as a background task using the windows schedular or from the command prompt.
    My problem is it does not work under SAP Business One SDK 2008 PL18 with SQL Server 2008, Visual Studio 2008.
    I receive the following message after this line in my code,"oReport.PrintToPrinter(CopyNo, False, 0, 0)".
    'CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
    Error in File XX_Report_Ver_0.01 {1A6620A2-5D73-49D2-9347-32ED068AA64E}.rpt:
    Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): Logon failed.
    Error in File XX_Report_Ver_0.01 {1A6620A2-5D73-49D2-9347-32ED068AA64E}.rpt:
    Unable to connect: incorrect log on parameters.
       at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
       --- End of inner exception stack trace ---
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.
       at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
       at BGProductionRpt.ECR_Common.ECR_PrintReport(Int32 CopyNo) in C:\SDK Development\8.8\test\XX_Rpt\ECR_Common.vb:line 485'
    My Question is what Crystal Reports libraries or other method should I be using ?
    Crystal Reports 2008 for SAP Business One eg. 51038978.zip - downloaded from portal obviously dosn't contain the CrystalDecisions libraries.
    Crystall Reports 2008 - cr2008_sp3_fullbuild, cr2008fp33.exe, cr2008fp33_mm, cr2008fp33_clickonce - also download from the portal, the cr2008_sp3_fullbuild does contain the crystal decisions libraries.
    Finally other choices are crystal reports included with the visual studio 2008 and crystal reports full version direct from Business Objects.
    I have tried different versions of crystal decision libraries- eg, 12.0110 or 12.02 but still no joy.
    Also if I manage to get the report to fire what should the client be running eg, if they have the Crystal Reports 2008 for Business One do they also need to install the Crystal Reports Run time - cr2008fp33_clickonce.
    Any help would be appreciated.
    Thanks.

    Hi John
    Since the SDK works in 2007 it will be using the OLD DB access method.
    Change the Crystal report to use an OLE DB datasource rather than the SAP Business One data source.
    Regards
    Rob

  • SAP Business One iPad Apps Sales Catalog photo problem

    Dear all,
    I have a question about the iPad SAP Business One Mobile Apps Sales Catalog.
    Inside the Sales Catalog, it will show the Item group with pictures and when you look inside the item group, it will show the Item image which is set up in the Item Master.
    Can anyone help on this? Thanks very much.

    According to the B1if sap.GetItemPicture Scenario, the path to the picture is looked up by the following query.
    SELECT BitmapPath AS 'bitmappath' FROM OADP
    The PictureName is passed into the GetItemPicture web service as a parameter.
    This leads me to my next question:
    What do you have the Pictures Folder (BitmapPath) set to in General Settings?
    I am guessing you have it set to C:\Program Files\SAP\..........
    The problem with this is that it save the picture to your local client computer and B1if is running on the server.  You will want to change the path to a network path that looks something like this:
    \\server\b1_shr\Pictures
    Why?
    If the Pictures Folder is set to C:\Program Files\SAP\.....
    1. When a user attaches an image, SAP Business One client places the picture in C:\Program Files\SAP\..... path on the client workstation, not on the server.
    2. B1if is usually run on the server and does not have access to a client workstation
             If Pictures folder is C:\Program Files\SAP\......., B1if looks up the Pictures Folder set in the database and appends the file.  In this case, B1if is reading C:\Program Files\SAP\.....\<imagefile>.jpg on the server in which B1if is running.
    3. The only time using a C:\Program Files\SAP\......  would work is when the client, server and B1if is running on the same machine and the permission to the C:\Program Files\SAP\..... folder is set up to allow B1if to read from the directory and the client to write to the directory.
    Using UNC notation
    if the Pictures Folder is set to a UNC path \\Server\b1_shr\Pictures
    1. When the user attaches an image, SAP Business One client places the picture on the server
    2. B1if will read the picture from the server from the shared folder on the server
    Conclusion
    You need to use UNC notation to identify the path of the Picture Folder so that all pictures are placed in the same location.
    What is your path set to for the Pictures Folder in General Settings?

  • Issue running a report from SAP Business One

    I have an issue running a particular report from SAP Business One. I am using Crystal Reports Add-On, all of the reports are working fine except one. When accessing the last page of the report or any page from inside the report the followiong error appears in the dialog box:
    Error in the File CollectionDate_Branch_wise {609BA059-89AF-41E9-9AEB-28CB16D13852}.rpt:
    The request could not be submitted for background processing.
    Edited by: Iqbal Faisal on Feb 22, 2010 6:03 AM

    Hi,
    Do you mean you have a Main report that is written based on SQL Command and there are 8 subreports linked to the main report?
    If that is the case, I assume when user select 'Document Type" eg invoice, it will pass that to the subreport and retrieve information?
    This is how I will approach it.
    1. Make sure the connection is consistent, if you are using ODBC(RDO) then make sure that is the same for main and subreport. You can check that in Set database connection. Right click on the connection, look at the Properties.  Don't assume that the name is the same, eg: SBO_DemoUS, they are all ODBC(RDO) for instannce.
    In Crystal, when you are using different connection, it will just prompts you a warning message and it will still run.
    2. Delete all and only keep one subreport, example AR invoice and see it will still give a problem.
    Replace the parameter with a set value in Record selection in subreport and see what happen.

  • SAP Business One 8.8

    Hi Al,
    can any one of you provide me the link for downloading the  SAP Business One 8.8 .when will the full version be released.is the released version the beta one
    Edited by: micheal willis on Jul 22, 2009 5:25 PM

    Hi micheal,
    You can download B1 v8.8 from here.
    You need a S-Username to gain access.
    Regards,
    Vítor Vieira

  • SAP Business One 8.8 Database

    I am using SAP Business One 8.8.
    In the middle of working in SBO 8.8, it suddenly shut down. When I tried to log in again, the list of companies dissapeared. Seems like there's no database connection. The server and database (Ms SQL server) seem to be up and running. We turn off and on Ms SQL server and it seemed to work now.
    According to our source, it indicated this has something to do with the policy in Ms SQL Server. Apparently, we took some companies within the database online and offline. This somehow trigger to lock the 'sa' access and disconnect the database. How do I prevent this from happening again? If this has to post in a different forum, i.e. Ms SQL Server, i will post there accordingly. Thanks.

    Hi Gordon,
    I checked the log files and it seems like user 'sa' was trying to access the database numerous times. This somehow trigger the Ms SQL Server policy and completely locked out ALL companies in the database. No one is using sa in the company.
    The only thing I can think of is when I test crystal report, it prompted 'sa' by default at the database login screen. I normally select 'integrated security' to bypass that screen. However, I was doing that for the past few months and never had problems until yesterday. The 'blank' screen of company list has happened twice.
    In SQL Server, I checked off 'enforce password security' for user sa. Will that be enough to fix the problem?

  • SAP Business One 8.8 Developer License

    Hi,
    I am relatively new to SAP but has years of experience has a developer. I would like to develop competencies on SAP Business One 8.8 (or the latest version) to enable me deploy, consult and develop add ons for the platform.
    I would like to aquire a single developer's license that would enable me install the solution and the SDK on my laptop and also download the solutions.
    I do not have a SAP business Partner account or access to the market place. I am also interested in books on the subject but I only got a book on SAP Business One 2005 edition.
    I would appreciate any advise or assistance on this.
    Regards
    Debola

    Hi, I'm just new here in sap community. I read some of your post and i know you can provide an answer.
    I have a Laptop, corei3, 4gb ram 500gb  and win 7pro. Im planning to install the sap B1 8.8 pl 10 for training purposes only.
    Is it possible to run SAP B1 on my laptop?Do I need to add ram?  I don't have other hardware to use. If it is possible please provide me the step by step procedure on how to install it.
    Thank you and Im hoping for your responce.. Tc

  • Business Impact Study on SAP Business One Training

    Dear SAP Business One Community,
    SAP is investing in finding out how the SAP Business One training is affecting your daily business.
    Please fill out this survey to help us finding out how effective the SAP Business One training is, and how well it meet your needs.
    We will hold a drawing for
    10 World Travel Adapter plus 10 USB Laser pointer (5 per partner survey and 5 per customer survey)
    from all people (separate drawings for partners and customers) who complete the survey and include their contact information. Participants from the SDN will also receive SDN points for attandance.
    Your entered data will be protected with SSL.
    There are two different surveys. One is for SAP Business One Partners and one is for SAP Business One Customers. Please participate in the survey, which belongs to your role.
    The survey will be available until midnight CEST on September 30, 2008.
    You can complete the related survey in 10-15 minutes.
    Please read the terms and conditions for the survey first. You will find them on the first page of the survey.
    [Access Partner Survey|https://www.surveymonkey.com/s.aspx?sm=BPnrjiHwoKKZ56PihoNyHQ_3d_3d].
    [Access Customer Survey|https://www.surveymonkey.com/s.aspx?sm=9c8MIxKy0Gckd9w8xWEiUA_3d_3d].
    Thank you very much in advance for your participation.
    Kindest regards,
    SAP Business One Training Team
    Edited by: Darius Heydarian on Sep 15, 2008 2:38 PM

    I'm not sure if this is the right forum for my query. any suggessions?
    Regards
    Pranav

  • Error while running  DTW in SAP Business One 9.0

    Dear All,
    Error while running  DTW the error shows that in SAP Business One 9.0 & PL 08 the 'Unable to access SBO-Common Database'  & attached the screen shot for the same.
    Kindly guide for the same
    Thanks&Regards
    Umesh Vaidya

    Hi Umesh...
    check with these links
    http://scn.sap.com/thread/3164843\
    -111 Cannot access sbo-common database
    Unable to access SBO-Common database
    865191- DTW Troubleshooting Guide
    Hope Helpful
    Regards
    Kennedy

Maybe you are looking for