Recognize a SAP session started in Python 3.9
Project detail
I need the code to recognize the open session in SAP to start woking on it.
VERY IMPORTAT:
I already have the code to access SAP since the begining (introducing user and password) I am not looking for it. In fact that code is every where.
The situation is this:
Before anything, I am going to ask the user to enter his SAP System and his user.
Once he entered the data the code verifies that there is a session already logged in with that information so now he is able to run a T-code and if it’s not, it will show a message telling it didn’t find the session.
THE CODE DOESN’T ASK PASSWORD because the user has already logged in SAP before he use the code. The code just verify that the session matches the user and the system that we already gave and set it as the session. (e.g: Session = mySession)
So then I can follow with the script.
E.g:
Session.findByID(“wnd[0]/tbar[0]/okcd”).text = “MY T-CODE”
Session.findByID(“wnd[0]”).sendVKeys(0)