Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

No current period when oCompany.Connect()

Hi All,

I have this error when i try to connect the company with the DI :

"-222 No current period"

In my company, i defined a current posting period : Posting Date from 01/01/2008 to 31/01/2008. The exercice begins in 2008. After i want to create my partners ...

This is the code, i'm use to connect the company throw the DI :

SboGuiApi = new SAPbouiCOM.SboGuiApi();

// by following the steped specified above the following

// statment should be suficient for either development or run mode

//SboGuiApi.AddonIdentifier = "5645523035446576656C6F706D656E743A4E3036323136303439343550F780D9E1AA20456293BA6DBC6CE031FF774237";

sConnectionString = Interaction.Command();

// connect to a running SBO Application

SboGuiApi.Connect(sConnectionString);

// get an initialized application object

SBO_Application = SboGuiApi.GetApplication(-1);

SBO_Company = new SAPbobsCOM.Company();

sCook = SBO_Company.GetContextCookie();

conStr = SBO_Application.Company.GetConnectionContext(sCook);

retour = SBO_Company.SetSboLoginContext(conStr);

if (retour != 0) SBO_Application.MessageBox("Error : SetSboLoginContext())", 0, null, null, null);

else retour = SBO_Company.Connect();

if (retour != 0) SBO_Application.MessageBox("Error : Connect() " + retour.ToString() + " ) " + SBO_Company.GetLastErrorDescription() + SBO_Company.GetLastErrorCode().ToString(), 0, null, null, null);

How can i resolve this problem ? Thanks for your response.

Best regards

Michael

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question