Hello UiPath,
longer ago @Nicholas_Doss wrotes a post about not clickable icons in SAP ALV (ABAP List Viewer) grids. Unfortunately nothing has changed until today. It is not possible to click any button in an SAP ALV grid. But ALV grids are a very common representation form of data in business processes that works with the SAP GUI for Windows. It is really a limitation not to be able to use these buttons.
With the SAP GUI Scripting it is very easy possible to analyze the buttons in the toolbar. Here an example which is available on any SAP system. Call transaction code SE38 with the demo report BCALV_GRID_05.
The IDs of the controls shows us an ALV grid.
To use the buttons of this ALV grid here a tiny SAP GUI Scripting example. It loops over the ToolBar and shows for each button different technical specifications like ID, Text, Tooltip and Type. If the Tooltip is “Layout ändern…” will the button pressed, depending on the type of button.
Set Grid = session.findById("wnd[0]/usr/cntlBCALVC_TOOLBAR_D100_C1/shellcont/shell")
For i = 0 To Grid.ToolBarButtonCount
If Grid.GetToolBarButtonType(i) <> "Separator" Then
Text = Grid.GetToolBarButtonId(i)
Text = Text & " - " & Grid.GetToolBarButtonText(i)
Text = Text & " - " & Grid.GetToolBarButtonTooltip(i)
Text = Text & " - " & Grid.GetToolBarButtonType(i)
MsgBox Text
If Grid.GetToolBarButtonTooltip(i) = "Layout ändern..." Then
Select Case Grid.GetToolBarButtonType(i)
Case "Button", "Menu"
Grid.pressToolbarButton Grid.GetToolBarButtonId(i)
Case "ButtonAndMenu"
Grid.pressToolbarContextButton Grid.GetToolBarButtonId(i)
End Select
End If
End If
Next
In my opinion, it would be very profitable to expand the recorder of UiPath Studio to this function. If the type is GuiShell and the sub type is GridView you can analyze on this way if a toolbar exists. If yes you can detect the handle and with this handle you can analyze the sub components of the ALV grid. Here an example with Windows Detective.
The toolbar has its own control, as shown here. Unfortunately I did not find a way to explicitly assign this toolbar to a variable in SAP GUI Scripting.
I suggest to expand the UiPath recorder with this feature. On this way everyone could simply use the buttons of an ALV grid.
Thanks and best regards
Stefan