I have been trying to start a new SAP session from scratch by calling its API from the Excel VBA. Thanks to this forums I've managed to start a new SAP window, enter my credentials and successfully log in to the system. However, I can only think it is successful because when the credentials are correct, the window disappears and nothing happens after that. If I enter the incorrect credentials, it won't let me through which I understand as a sign that the session is properly connected to the database.
Is there any way to force the SAP GUI keep open after I log in? Is it normal that it disappears?
The code I use to prompt the logon window:
If SapGuiApp Is Nothing Then
Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
If Conn Is Nothing Then
Set Conn = SapGuiApp.OpenConnectionByConnectionString("mycompanyserver.com", True, False)
If SAPSesi Is Nothing Then
Set SAPSesi = Conn.Children(0)
After that I want to be able to run the macro the following way:
.findById("wnd/tbar/okcd").Text = "TRANSACTION"