cancel
Showing results for 
Search instead for 
Did you mean: 

SAPGUI Script Execution

0 Kudos

Hi,

In SAP we can run internally a SAPGUI Script (VBS) inside of SAP by calling the Script Recording and Playback - is there a way to call that Script Recording from outside to run in is the CMD line and pass the name of the Script?


As well - which are the DLLs required to run a SAPGUI Script in Visual Basic and C#.

I dont want to run it from Excel - neither convert it to VBA

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schnell
Active Contributor
0 Kudos

Hello Maria,

you have several ways to execute an SAP GUI Script:

  1. Via recorder - as you described.
  2. Via drag and drop - move the script file from your Windows Explorer to your SAP session.
  3. Via double click on the script in the Windows Explorer.
  4. Via CMD - wscript.exe MyScript.vbs

All should work without any problems.

You can find SAP GUI Scripting in the file SAPFEWSE.OCX in the directory "C:\ProgramFiles (x86)\SAP\FrontEnd\SAPgui". Create from this file your own interop wrapper via tlbimp. On this way you can use SAP GUI Scripting seamlessly with C# and VB.NET.

Best regards
Stefan

Thank you - I was trying to run it from Blueprism - which is a RPA tool - We are trying to keep everything inside of Blueprism without adding more DLLs or external dependencies -

I thougth about the wscript - but all the steps involving

CreateObject("Wscript.Shell"), etc etc, and DLLs I needed to add in BP - gave me second thoughts.

1. What I did is created the macro with the recorder

2. Adjusted to be a VB program - As you mentioned - but without using the SAPFEWSE.OCX - So I did not create another dependency and we could move the program anywhere on any environment

3. I use the Excel VBO object - to run it.

So in that way the dependency statys in BP and Excel - minimizing impact -
What I was doubting - if I just called it from VB - as a vbs - what will happen -

Thank you for the information - You gave me another two days to do this - without adding external dependecies.

By the way - thank you for your last answer - You saved the day!! We are so deep in what we are doing we would never would have figure it out!!

One more time you saved my day!!

Answers (0)