L
L
Leonid2018-12-28 13:33:36
SAP
Leonid, 2018-12-28 13:33:36

How to start programming for SAP R2 (VBScript)?

Please tell me how to program for SAP R2 (VBScript).
I have SAP running through Citrix in a sandbox.
All I could do was record some kind of macro (for me, complete dregs):

spoiler
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"
End If
session.findById("wnd[0]").resizeWorkingPane 172,32,false
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").expandNode "F00002"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").expandNode "F00006"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = "F00025"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").topNode = "Favo"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").doubleClickNode "F00025"


What to do next, how to program? What is the object model, how to connect?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Popov, 2018-12-29
@IronBream

Hello, I must say that the world of SAP is so big that I never got around to writing scripts myself, except when SAP generates them itself, through internal tools.
But, this did not stop me from realizing in a couple of minutes that there is a separate community on your topic on the official SAP site.
Here is the link, I hope you will find answers to your questions: lmgtfy.com/?q=vbscript+sap

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question