I've SAP GUI 6.4 and SAP Business Client 6 installed on my machine. I'm able to use SAP scripting without any issue when working on SAP GUI 6.4 but when trying to use scripting on SAP GUI launched from SAP business client i'm unable to get any SAP connection object.
I've verified that scripting is enabled on client as well as server side. I was able to get 'GuiScriptingEngine' object after retrieving SAP GUI object from window ROT. However I’m unable to retrieve connection object from 'GuiScriptingEninge' object as it does not has any children. No matter how many SAP connection/session are up, it always returns 0 child.
Since i no have access to any children so i cannot get connection and session object and use any automation. I'm using following code:
Set oSAPGui = GetObject("SAPGUISERVER")
If Not oSAPGui Is Nothing Then
Set application = oSAPGui.GetScriptingEngine
End If
If application.children.count > 0 then
set Connection = applicaton.children[0]
End if
During the Object retrieval form window ROT, i have also tried 'SAPGUI' instead of 'SAPGUISserver" but it yields same results.
I've also tried to use SAP native scripting record and play back and though i was able to record SAP script through it but it produce same error during the play back.
Is SAP has broken scripting support in business client 6?