Skip to Content
1
Nov 12, 2020 at 07:38 AM

Get Text from the displayed results - VBScript

691 Views Last edit Nov 11, 2020 at 03:30 PM 2 rev

Hello There,

I am new here and to SAP Scripting as well, and i am trying to get the text from one of the displayed GUI screen at the give caretPosition (last but one line). Here is the recording ...

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]").maximize session.findById("wnd[0]/tbar[1]/btn[17]").press session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").pressToolbarButton "&FIND" session.findById("wnd[2]/usr/txtGS_SEARCH-VALUE").text = (Wscript.Arguments(0)) session.findById("wnd[2]/usr/txtGS_SEARCH-VALUE").caretPosition = 7 session.findById("wnd[2]/tbar[0]/btn[0]").press session.findById("wnd[2]/tbar[0]/btn[12]").press

appreciate your help

also please kindly suggest some resources to learn SAP VBScripting

Hara