Skip to Content

Login into Sap B1 with an external Program

Hello,

I am currently working on a Program in C# that is supposed automatically login into SAP and do a few tasks in it and then logout and close it at the end. My Problem is that I don’t know how to do the login into the client. I know how to connect to the UI client but I don’t know how to go from there. Is there a way to do it without the user having to login himself?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 20 at 08:38 AM

    Hi Alexander Rusner,

    It depends on the task which you want to perform. You can use DI API for this too.

    Here is an sample to make a DI API company connection:

    oCompany = new SAPbobsCOM.Company();
    oCompany.Server = @"mo-dac04f24a.mo.sap.corp,63833";
    oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008;
    oCompany.CompanyDB = "263408";
    oCompany.UserName = "manager";
    oCompany.Password = "manager";
    oCompany.LicenseServer = "mo-5722ce411.mo.sap.corp:30000";
    int A = oCompany.Connect();
    

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you for the reply,
      but my problem is that I need to use the UI because we are using Coresuite and I want to automate an Import function. Because of that there are no Di API functions I can use. So I am asking if it is possible to login into the sap Client, as I already explained I know how to connect to the activated SAP client but I don’t know how to login after that. So is there a way to do that and if so how do I do that?