Read Table Contents
sap_read_tableRead SAP table or view data with optional field selection, WHERE filtering, and row limits to fetch only authorized business or customizing records.
Instructions
Read the CONTENTS of any table or view the user is authorized for, via the ADT SQL Data Preview. This is the primary tool for reading customizing (T*) tables and business data.
Args:
table (string): table/view name.
fields (string[]): optional columns; omit for all.
where (string): optional WHERE clause without the 'WHERE' keyword. Use single quotes for literals.
max_rows (number): 1-1000 (default 100).
response_format ('markdown' | 'json').
Returns (json): { query, columns: [{name,type,length,description,key}], rows: [{col: value}], rowCount, totalRows, truncated }.
Examples:
"Show company codes" -> table='T001', fields=['BUKRS','BUTXT'].
"CO-PA derivation rules for strategy 1" -> table='TKEDRS', where="kalsm = '...'".
"FI documents for company 1000 in 2026" -> table='BKPF', where="bukrs = '1000' AND gjahr = '2026'", max_rows=50. Notes & Error Handling:
Read-only (SELECT only). Authorization is enforced by SAP (S_TABU_*).
403 -> the user lacks display authorization for this table.
Large tables: always pass 'where' and/or 'fields' and a small 'max_rows'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table or view name (e.g. 'T001', 'BSEG', 'TKEDRS'). | |
| where | No | Optional ABAP-SQL WHERE clause WITHOUT the 'WHERE' keyword, e.g. "bukrs = '1000' AND gjahr = '2026'". | |
| fields | No | Optional list of columns to return. Omit for all columns ('*'). | |
| max_rows | No | Maximum rows to return (1-1000, default 100). | |
| response_format | No | Output format: 'markdown' (human-readable, default) or 'json' (structured). | markdown |