on 09-14-2017 7:06 AM
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
dim sapRow
sapRow = 0
Set GRID1 = session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell")
'session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").currentCellRow = 9
For sapRow = 0 to GRID1.rowCount - 1
'on error resume next
Value = GRID1.GetCellValue(sapRow,"Notification") - I get an error on this line
next
Good Day!
I am trying to learn SAP Scripting to automate some of the tasks that we have in SAP.
I want to read grid cells and to check if there is an existing notification in SAP based on the description of each notification. I am getting an error when I try to do a loop to check each available row for any matches. I am not sure on how to store the content of the Notification column into a variable. Any help would be appreciated.
Thank you.
Hello Nicolas,
welcome here in the forum.
I wrote a blog about this requirement, you can find it here. With the solution I described you can read any grid and get the content of each cell.
Let us know your results.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nicolas,
it might be that the internal column name is quite different. But you can get it out. For example, you can use the script recorder to record a sort for that column. The name you are looking for is then in the script.
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.