Skip to Content
0
Former Member
Jun 08, 2008 at 10:21 AM

Single Sign On on SAP BO

245 Views

Hi there !

I am having some problems using single sign on in SAP BO .I have programmed it based on SAPBO samples so this is what I have :

Dim sConnectionString As String

SboGuiApi = New SAPbouiCOM.SboGuiApi()

sConnectionString = Command

'// connect to a running SBO Application

SboGuiApi.Connect(sConnectionString)

'// get an initialized application object

SBO_Application = SboGuiApi.GetApplication()

' Step 1

' Initialize the Company Object

vCmp = SBO_Application.Company

cookie = vCmp.GetContextCookie()

conStr = SBO_Application.Company.GetConnectionContext(cookie)

If vCmp.Connected = True Then

vCmp.Disconnect()

End If

ret = vCmp.SetSboLoginContext(conStr)

If Not ret = 0 Then

Exit Sub 'the operation has failed.

End If

vCmp.Connect()

On line "

vCmp = SBO_Application.Company" it gives me a NullPointerException . The question is , how do I initialise the vCmp value wich I have declared as SAPBobsCOM.Company .

Sorry for my lack of experience, I am begginer so ...

Best regards,

Ivan Frias

Edited by: Ivan Frias on Jun 8, 2008 1:47 PM

I forgot to istanciate company vCmp object . Now I have another doubt . When I make vCmp.Connect I get the error with code -222 indicating that there is "No current period"...

I would appreciate if anyone could help me here , telling how it is done , at least the things I need to research in order to accomplish my task .

Thanks,

Ivan Frias