I am trying to automate the SAP GUI. I have used the library SAPFEWSELib with which I am able to launch my the SAP GUI and connect. Now, I am created a desktop shortcut process (using a built in utility in SAP). So instead of launching and connecting every time I can directly go to the specific screen and automate the next steps from there. To achieve this, I would need to-
- Trigger the desktop shortcut to launch SAP
- Attach the current SAP session and perform the automation in C# using SAPFEWSELib library
I tried- var session = SapGuiApp.ActiveSession;
but I get session as null. Is there any other way to attach the SAP session to SapGuiApp?
Note- SapGuiApp
is a type of GuiApplication
object which is accessible using SAPFEWSELib.
References-