1

My company provides us access to S/4HANA through their corporate portal, not SAP GUI. I guess because of security reasons. Not sure how it logs us in, probably SSO or has some sort of session key in the back ground, but I tried the script below to automate some SAP processes and it does not played.

If Not IsObject(application) Then
   Set SapGuiAuto  = GetObject("SAPGUI")
   Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
   Set connection = application.Children(0)
End If
If Not IsObject(session) Then
   Set session    = connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session,     "on"
   WScript.ConnectObject application, "on"

If I go to the script file and double click it, I get a syntax error in line 2. I think because of lack of access to SAP through the GUI it asks me for a credentials (in portal I sign in through SSO).

Is this a reason of an error?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

1 Answers1

1

SAP Fiori interface which is default for S4HANA and which you presumably use in your corporate portal

does NOT support GUI scripting which naturally emerges from its title SAP GUI Scripting, i.e. it is only supported by SAP GUI.

What are the alternatives:

  1. SAP CBTA, Component-Based Test Automation. A tool intended more on testers but can be theoretically used by end-users too. Not user-friendly indeed, also requires Solution Manager, but it works with SAP Fiori among others.
  2. HP LoadRunner can be used with Fiori Dashboard too.
  3. UFT, Certify and other tools which are out of the scope of this questions, because officially not documented and supported by SAP

In concluding, I see no real automation replacement/successor for Fiori which is as simple and handy as SAPGUi Scripting for SAPGUI.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Thank you for your input! So the corporate portal is not web based only to launch it. It then opens up a GUI application window. Im guessing they are using some sort of session key to know who i am since i dont have to login at all. So iuf i run this Set SapGuiAuto = GetObject("SAPGUI") it doesnt know i have a GUI window open im guessing. – iampython2134 Apr 24 '20 at 12:31
  • So if you have SAPGUI opened after SSO login, you need to check if scripting is enabled on SAP system, it is disabled by default due to security reasons. This can be done thru RZ11 `sapgui/user_scripting parameter`, more on this [here](https://docs.uipath.com/studio/docs/enabling-sap-gui-scripting), but unlikely you have access to RZ11 transaction, so ask your Basis guys – Suncatcher Apr 24 '20 at 14:10
  • 1
    Maybe your portal opens no local SAPGui but Citrix SAPGui app tunneled from remote server? In this case you are out of the luck – Suncatcher Apr 24 '20 at 14:12