Handling GridView controls in SAP automation

A GridView in SAP is a dynamic SAP GUI component covering a table and optionally a toolbar. Components are the same as controls or elements. See details in Introduction to controls and selectors in SAP automation.

In IBM Robotic Process Automation, you can map the attributes of GridView controls using the IBM RPA Studio's recorder. The recorder highlights the control you map in purple, indicating the SAP mapping driver is active.

The following selector shows a sample GridView Id selector:

wnd[0]/usr/cntlG_CONTAINER_SELECTION/shellcont/shell

When a GridView has toolbar buttons, you can make your bot click it by adding /<THE_BUTTON_ID> at the end of the selector. For example:

wnd[0]/usr/cntlG_CONTAINER_SELECTION/shellcont/shell/&SORT_ASC

Some toolbar button IDs are: &SORT_ASC, &GRAPH, and REFRESH.

Starting from version 21.0.3, you can make your bot click on menus opened by GridView toolbar buttons by adding the menu option ID after /<THE_BUTTON_ID> at the end of the selector. For example:

wnd[0]/usr/cntlG_CONTAINER_SELECTION/shellcont/shell/&MB_EXPORT&XXL

To interact with a cell within the GridView control, add the cell position reference as /Cell(<ROW_INDEX>,<COLUMN_NAME>) at the end of the GridView ID selector. For example:

wnd[0]/usr/cntlG_CONTAINER_SELECTION/shellcont/shell/Cell(2,EXAMPLE)