03-31-2023 9:02 AM
My C# program was working fine with 7.40. After I updated to 7.70 the program no longer is able to start SAP.
This is the basics of the program. In 7.40 the "new GuiApplication()" launched SAP Easy Access. In 7.70 it does not. Instead, it closes my own program, without any error or even leaving anything to the try catch.
using SAPFEWSELib;
using SapROTWr;
public static class SAP
{
public static GuiApplication SapApplication { get; set; }
public static GuiConnection SapConnection { get; set; }
public static GuiSession SapSession { get; set; }
public static void Open()
{
SapApplication = new GuiApplication();
SapConnection = SapApplication.OpenConnection(connectString, Sync: true);
SapSession = (GuiSession)SapConnection.Sessions.Item(0);
Login();
}
public static void Login()
{
//stuff
}
}
The library does work as long as SAP is already open. I can connect to it with:
sapGUIROT = sapROTWrapper.GetROTEntry("SAPGUI");
SapApplication = (GuiApplication)sapGUIROT.GetType().InvokeMember("GetScriptingEngine", System.Reflection.BindingFlags.InvokeMethod, null, sapGUIROT, null);
SapConnection = SapApplication.OpenConnection(connectString, Sync: true);
SapSession = (GuiSession)SapConnection.Sessions.Item(0);
Any idea what might have changed 7.40 -> 7.70, or what might be the problem?
02-07-2024 11:55 AM
This has happened with me as well, script used to work fine with SAP 7.7 but it stopped working after upgrade to sap 8.0 can someone please help me here
P.S: Enabled scripting and accessibility options as well.