How to loop through each data in SAP table (access each row)


so based on image above, i need to double click each row in order to access their menu, but how can i do that? i cant use for each ui element in SAP.

Hi @luthfi.maajid

Use Data Scraping Activity:

  • you can use the Data Scraping activity to extract the data into a DataTable directly.
  • Configure the Data Scraping wizard to select the table headers and data cells. This will create a DataTable variable that holds all the table data.
  • Loop Through Each Row in the DataTable:
  • Use a For Each Row activity to iterate over each row of the DataTable:
    1. Set the For Each Row activity’s DataTable property to the variable created by the Data Scraping.
    2. Within this loop, you can access each column’s value in the current row by referencing row("ColumnName") or row(index) if you know the column index.
  • Perform Actions on Each Row:
  • Inside the loop, using row(index) & `row(“ColumnName”) create ur double click activity selecter

@luthfi.maajid
Use Data Scraping Activity:

  • you can use the Data Scraping activity to extract the data into a DataTable directly.

  • Configure the Data Scraping wizard to select the table headers and data cells. This will create a DataTable variable that holds all the table data.

  • Loop Through Each Row in the DataTable:

  • Use a For Each Row activity to iterate over each row of the DataTable:

    1. Set the For Each Row activity’s DataTable property to the variable created by the Data Scraping.
    2. Within this loop, you can access each column’s value in the current row by referencing row("ColumnName") or row(index) if you know the column index.
  • Perform Actions on Each Row:

  • Inside the loop, using row(index) & `row(“ColumnName”) create ur double click activity selecter

First, try combining hotkeys and selectors. Attach the SAP window using Attach Window, then use a dynamic selector to target each row based on the Item number or row position. If specific row selectors aren’t available, use the down arrow key to navigate between rows and trigger a Double Click on the currently selected row. Repeat this action in a loop, adjusting the number of down arrows for each row.

You could also send hotkeys like Enter or F2 on each selected row to open the context menu. In many SAP setups, these keys simulate a double-click effect. Use Click Text or similar methods to navigate to the row and send the Enter key in a loop, which avoids double-clicking.

Another approach is to use dynamic coordinates in the Click activity. Calculate the row coordinates and use OffsetX and OffsetY properties. Determine the Y-offset difference between each row and increment it in a loop to double-click each row.

If individual cells in each row are accessible, use Click on a specific cell, such as the “Item” column. Set up dynamic selectors by iterating through variables that update per row, allowing you to interact with each row one by one.

Try Anchor Base with scrolling. Use a stable reference point in each row, like a value in the “Item” column, to locate rows. Combine this with Page Down or scrolling activities if the table exceeds the visible screen area.

Regards,
Kardelen

Using UI Automation and Dynamic Selectors

We can create a dynamic selector to access every row in the SAP table. We can set a dynamic selector using the index number of each row and double click on the row with the Click activity.

Step by Step Solution:

  1. Get Table Row count - Find the total number of rows in the table using the Get Text or Get Attribute activity
  2. For Each Loop: Using a For Each loop, sort the row indices (for example, starting with index = 0).
  3. Creating a Dynamic Selector: Use a dynamic structure as a selector in the Click activity. For example:

The {index} value in this selector will increment with each step within the loop.
4.Double click : In the click activity, select the click Type setting as Double click.