Through a lot of Googling I managed to connect to SAP and open a transaction from VBA code. This is not part of the problem, so I won’t include it here.
My problem is as follows: Now that I have the transaction open, I want to enter values into the fields of the transaction from my code.
I assume this is done by code similar to this:
However, the /usr/ctxtVendor part is obviously wrong. If I understand correctly, this is pretty much different on a company basis.
One solution is to use the “SAP Script Recording & Playback” utility to generate VBA code and extract the variablenames. Unfortunately I am not authorized to use this, and I won’t be any time soon so that is not an option.
EDIT: I found a second solution:but it doesn’t seem as if I have access to this.
Are there other ways of discovering the identifiers for this and other transactions?
Thank you for reading and hopefully for providing an answer.
Sorry i gave you the wrong info for VBA scriptable names. Make your window a variable like so:
Dim window As SAPFEWSELib.GuiFrameWindow Set window = session.FindById("wnd")
Then you go to the Locals window in your VBEditor, and see it here:
For me, the /usr area is Item 5 of the window children, open it up and look for all the fields listed. You can use the path provided. E.g. Below i have opened up Item 2 which is Account number, and you see the string needed in Id property.
Then you use it like so:
window.FindById("usr/ctxtRACCT-LOW").Text = "A123456"