cancel
Showing results for 
Search instead for 
Did you mean: 

Using UI ?

Former Member
0 Kudos

Hi.

Im new to the SBO UI and would love to have explained how this works. I already know the DI.

I use C#.NET.

I would love to have explained - maybe even with some examples how to:

1. Connect to the UI

2. Run a form (let's say it should have 2 buttons) and a datagrid with some data from a table of your choice

3. Catch the button-clicked events and retrieve the chosen data from the grid..

Can you recommend some documentation or share some of your knowledge - it would be much appreciated.

The Best Regards

Allan Rasmussen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kanon! As one would say in danish...

Exactly what I needed.. Thank you very much..

The best regards

Allan Rasmussen

former_member374
Active Contributor
0 Kudos

You are thanking a poster for his answer.

Please next time also give him points.

See: /people/mark.finnern/blog/2004/08/10/spread-the-love

This time I did it for you.

Remember: When you ask a question you also assume the responsibility to assign points.

Please check your other questions and if the answers were good.

Spread the love and give some points.

Thanks in advance, Mark.

Former Member
0 Kudos

Wasn't aware of that point system. I'll keep that in mind next time..

Answers (1)

Answers (1)

Former Member
0 Kudos

There are a bunch of examples at https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sap business one sdk ui api samples.htm

This last link is on the right side of the developer page which is at: https://www.sdn.sap.com/sdn/developerareas/businessone.sdn?node=linkDnode10

Below is some code I use to connect to the UI first and then to do a "Single sign on" to the DI.

Hope this helps.

-Mel

Private Sub SetApplication()

Dim SboGuiApi As SAPbouiCOM.SboGuiApi

Dim sConnectionString As String

'//Connect to the GUI API Application Object

Set SboGuiApi = New SAPbouiCOM.SboGuiApi

'// for development mode:

'// the Connection String key must be put int the command line argument

'// of the project properties

sConnectionString = Command

'// connect to a running SBO Application

SboGuiApi.Connect sConnectionString

'// get an initialized application object

Set oSBO_Application = SboGuiApi.GetApplication()

End Sub

Sub SetCompany()

Dim sConstrDI As String

Dim sCookie As String

Dim ret As Long

'//Single sign on to DI Api Company Object

'//Acquire the connection context cookie from the DI API.

sCookie = oSboDICompany.GetContextCookie

'//Retrieve the connection context string from the UI API using the 'acquired cookie.

sConstrDI = oSBO_Application.Company.GetConnectionContext(sCookie)

'// before setting the SBO Login Context make sure the company ' is not connected

If oSboDICompany.Connected = True Then

oSboDICompany.Disconnect

End If

'Set the connection context information to the DI API.

ret = oSboDICompany.SetSboLoginContext(sConstrDI)

If Not ret = 0 Then

'the operation has failed.

Call Err.Raise(vbObjectError + errITEM_Company, "clsSBOManager.SetCompany", errITEM_CompanyStr)

End If

'Establish the connection to the company database.

ret = oSboDICompany.Connect()

If ret <> 0 Then

Call Err.Raise(ret, "clsSBOManager.SetCompany", "oSboDICompany.Connect")

End If

End Sub