Skip to Content
author's profile photo
Former Member

Using UI ?

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Aug 17, 2004 at 11:33 AM

    Kanon! As one would say in danish...

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

    The best regards

    Allan Rasmussen

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Aug 16, 2004 at 09:29 PM

    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

    Add comment
    10|10000 characters needed characters exceeded