sap_read_table
Read rows from the current SAP screen table, auto-detecting ALV grid or TableControl, with column selection, schema discovery, and pagination for large tables.
Instructions
Read rows from a table on the current screen — ALV grid (report/list output) or TableControl (SM30 maintenance view, customizing screens).
Auto-detects the table type. The response includes a 'table_type' field ('GuiGridView' for ALV or 'GuiTableControl') so you know which type-specific tools to use next (e.g., sap_get_alv_toolbar for ALV, sap_scroll_table_control for TableControl).
Use columns_only=true for schema discovery (returns column metadata only, no data). For a TableControl it also gives each column's cell_type and a cell_id template ({row} = zero-based visible row) for sap_set_batch_fields. Use columns to fetch only specific columns (CSV). Use start_row to paginate through large tables. On a TableControl a start_row (0 included) scrolls there first; without one the read starts where the table is scrolled now (e.g. after Position...). first_visible_row says which row is on top.
A TableControl's total_rows counts its empty lines too (SM30 pads the view). When the read reaches the first empty row, the response has empty_rows_from, that row's absolute index: the data ends there.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | ||
| max_rows | No | ||
| table_id | Yes | ||
| start_row | No | ||
| columns_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||