cancel
Showing results for 
Search instead for 
Did you mean: 

Connection via addon?

Former Member
0 Kudos

Hi,

I am still in the process of looking for more information about the SDK. I did manage to find the SAP B1 SDK Help Center download so I can now look throught that.

My question is about if I am to make a plugin(addon) for SAP B1. Do I have to have it connect to the database on its own while SAP is running or if SAP is running can I just execute commands via the API?

I'm trying to start out with getting the basics with the SDK then I can try and look up more information on what fields I need to retrieve for my project. Mainly I need Quotation data. Line Item's weights, customer information. Then I need to figure out how to put a value back into the Quotation (shipping costs).

My project seems smalls, but having to start from scratch makes it seem harder than I think it is.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To Check the version of your DIAPI right click to check the properties of the following file:

Program Files\SAP\SAP Business One\DIAPI\2005\sapbobscom2005.dll

You need to go to the version tab and scroll down in the box on the lower left to display the special build which is the patch level.

You can compare this with the version in sapb1 help about.

If the versions don't match you need to use add/remove programs on the control panel to remove the DIAPI and then install the correct version.

Version mismatch with the DIAPI can give unpredicitable errors.

Former Member
0 Kudos

It seems that the .dll is version 6.80.121 and the SAP version is 6.80.123.

So I dont have the correct API. Do I get the updated on via the Marketplace? I don't have our companies username/pass and the SAP business partner we use have not responded to my emails.

former_member184566
Active Contributor
0 Kudos

Hi Tyler I

When you install or do a patch upgrade you should unistall the sdk and then re-install the same version as the patch level. But usually if they are the sme in the sense SBO2005 and SBO 2005 sdk that does not usualy interfere. But if the one is 2004 and the other 2005 then you'll pick up problems. But yes, it is best to keep them at the same levels in case the patch has attended to any problems reported to sap.

Hope this helps

Former Member
0 Kudos

So if I am having an issue with the sample code for BasicOperations and conneting to a database with the same username/login that I use when I launch SAPB1, then I could possibly have a .dll issue?

I've looked over the connection code and it looks like this:


oCompany = New SAPbobsCOM.company
oCompany.Server = "192.168.123.76"
oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English
oCompany.CompanyDB = "TESTDB"
oCompany.UseTrusted = True
oCompany.UserName = "MYUSERNAMEHERE"
oCompany.Password = "MYPASSWORDHERE"

lRetCode = oCompany.Connect

if (iRetCode <> 0) Then
  oCompany.GetLastError(lErrCode, sErrMsg)
  messagebox.show(sErrMsg)
else
  Messagebox.show("Connected to " & oCompany.CompanyName)
end if

Which I believe is always retuning -107 which seems to be 'Invalid Username of Password'

former_member184566
Active Contributor
0 Kudos

Hi Tyler I

What version are you using. I tried my sample, works perfect the way it is and no alterations done to it by me. Im on SBO 2005. Remember that the password is case sensitive.

I see you are using a ip address, where are you running it. If you are running it on your own machine you don't need that ip address, you can use oCompany.Server = "(local)".

Also, the company you connecting to, does it have a valid fiscal period??

Also, is your DI API the same version as your patch??

Have you tried any of the other samples? have you tried connecting to a different DB??

Hope this helps

Former Member
0 Kudos

How do I check for a valid fiscal period? It was our training database from 3 weeks ago.

I also tried to connect to our live database.

I don't have a local database on my machine so I connect to our SAP Server, hense the IP address

Our SAP Server is a PL5 ver 6.80.123 but the API .dll is 6.80.121

I have not tried other samples since this one seemed to be the most basic and introduction for me.

I've also changed the text field for when I enter the password into the Samplecode so that I am entering the proper password. I just removed the * character from the password field.

former_member184566
Active Contributor
0 Kudos

Hi Tyler I

I'm assuming you are using 2005 and not 2004. It is easy to know if you have a valid fiscal period, when you log on through the front end it will give a message that your period is not valid, if no message comes up your period should be good. You can veiw your periods in Aministration->system initialisation-> general settings then the first tab on the left.

Also i'd suggest you go to a higher patch level if you are using 2005, i remember that patch 3 & 4 had problems with add-ons that can't connect....not sure if patch 5 solved it. But even still, patch 7 of 2005 seems to be steady.

Tyler, please try everything you do localy on your machine first. It will liminate any network problems and you never should run/test samples on live databases. Best is do it on your machine, make sure the db is correct and up to scratch.

Hope this helps

Answers (1)

Answers (1)

former_member184566
Active Contributor
0 Kudos

Hi Tyler I

In the sdk there si two parts you must focus on. DI API and UI API.

1)DI API stands for "data inteface API", this coonects to the database and you don't need a sbo client. You can use this to add invoices, journals, ect.

2)UI API stands for "User Interface API", this connects to the sbo client that will be running. You use the ui api to interact with the user when working in sbo through the client. It is the graphical side, use to make forms and buttons and so on.

Note, if you need to use a combination of both of them at the same time we then refer to it as a "single-sign on".

Hope this helps

Former Member
0 Kudos

So it seems I will need to use the 'single-sign on' method.

Since I will need a make a small form for SAP to do what I want.

Though I've been playing with the BasicOperation code that I found and I cannot get it to accept my username/password it says they are incorrect but its the same I use when I am running SAPB1.

Could this be, because we are using SAP B1 2005A PL 5 but the COM files might not be of the same version? How do I check to see what verion the COM files are? It said that the

SAP Bi DI API v2005 is verison 2005.0.0.0

Is there a newer one I should have?