Return variable from SAP VBScript back to Studio

Hi,

I wrote a small script within SAP and i need the result as output back in Studio. Any idea how this can be achieved …

Thanks
Hara

I prefer VBA, this makes it easy to get results back from invoke VBA activity.

I just looked in the docs: VBScript can also give back values and UiPath can take them:

1 Like

@Hara_Gopal

Hello Hara,
here a tiny example how to deliver the number of data table entries in TADIR table.

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

session.findById("wnd[0]").resizeWorkingPane 98,24,false
session.findById("wnd[0]/tbar[0]/okcd").text = "/nse16"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").text = "TADIR"
session.findById("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").caretPosition = 5
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]").sendVKey 31

WScript.Echo session.findById("wnd[1]/usr/txtG_DBCOUNT").Text

session.findById("wnd[1]/tbar[0]/btn[0]").press

WScript.Echo delivers the value back to your UiPath project.

Best regards
Stefan

4 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.