on ‎2020 Jul 14 2:14 PM
Hi,
Does anyone know where I can find a full documentation for SAPGUI scripting?
I have been using late binding in VBA and copying codes from recorded SAPGUI scripts into VBA but it would be much better if I can have a full list of available objects and methods to work with.
Thank you
Regards
Jay
Request clarification before answering.
Hello Jay, document, you will find in the DOCU folder of your downloaded SAPgui installation.
\Presentation_CD_1\<sapgui version>\DOCU\ SAP_GUI_Scripting_Security.pdf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From SAP GUI, menu "SAP GUI Scripting Help" below "Script Recording and Playback".
Or online here: https://help.sap.com/viewer/product/sap_gui_for_windows/760.02/en-US?q=SAP%20GUI%20Scripting%20API
Or online here: https://archive.sap.com/documents/docs/DOC-8971
EDIT July 16th 2020 : also in menu "SAP GUI Scripting Help" of SAP GUI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Sandra,
I have been using the below code in my VBA macros to connect the SAPGUI.
Dim SapGuiAuto, SapApp, SapCon, Session As Object
'Initiate SAP Connection
Set SapGuiAuto = GetObject("SAPGUI")
Set SapApp = SapGuiAuto.GetScriptingEngine
Set SapCon = SapApp.Children(0)
Set Session = SapCon.Children(0)
I have read the PDF document before but the objects and methods in it don't seem to be available in VBA.
Could you show me how to use them in VBA please?
Thank you very much
Regards
Jay
I don't understand what PDF you guys are all talking about... (the only PDF I see is "The SAP GUI Scripting API", presentation by Cohrs and Loff, which doesn't talk about objects and methods, other documents are in HTML or CHM format).
The preferred language is VBS, not VBA. If you want to use SAP GUI Scripting with VBA (i.e. via macros within MS Office applications), it should work with MS Office 32 bits, but not 64 bits unless you use the method explained in the note 2689304 - Usage of SAP GUI Scripting ROT Entry Helper (saprotwr.dll) by 64bit applications, which corresponds to the "DLL Surrogate" approach.
Thank you Sandra.
Sorry I can't access the link.
I'm a newbie in this and don't really understand what "DLL Surrogate" means. 😛
At the moment, I'm using the SAPGUI script recorder to record VBS code and then copy them into my VBA code, which all use the method "FindByID".
If I understood this correctly, it seems the "FindByID" method is the only method available for Office 64 bits?
Jay Geng "All use the method FindById" just because your recorded actions were simple and didn't imply other methods. It generates VBS code. VBS works by running the VBS file from Windows File Explorer from instance.
VBA looks like VBS, but it's not VBS. If you copy the VBS source code to a VBA macro, it may NOT work at all as I explained.
By the way, maybe you have other problems with your code. Could you explain what error message you get, at what line?
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.