$npx -y skills add jfilak/sapcli-claude-plugin --skill abap-sql-queryExecute ABAP SQL (OpenSQL) queries against a connected SAP system using the sapcli datapreview osql command.
| 1 | ## What I do |
| 2 | |
| 3 | I run ABAP SQL (OpenSQL) SELECT queries against a connected SAP system and |
| 4 | display the results. I use the `sapcli datapreview osql` command under the hood. |
| 5 | |
| 6 | ## When to use me |
| 7 | |
| 8 | Use me when you need to query SAP database tables directly — for example to |
| 9 | inspect table contents, check configuration entries, or retrieve data for |
| 10 | analysis or debugging. |
| 11 | |
| 12 | ## Basic usage |
| 13 | |
| 14 | ```bash |
| 15 | sapcli datapreview osql "SELECT * FROM <TABLE>" |
| 16 | ``` |
| 17 | |
| 18 | ## Limiting rows returned |
| 19 | |
| 20 | Use `--rows` to cap the number of result rows (default is determined by the |
| 21 | system): |
| 22 | |
| 23 | ```bash |
| 24 | sapcli datapreview osql --rows 20 "SELECT MANDT, CARRID, CONNID FROM SPFLI" |
| 25 | ``` |
| 26 | |
| 27 | ## Output formats |
| 28 | |
| 29 | Results can be displayed in human-readable form (default) or as JSON: |
| 30 | |
| 31 | ```bash |
| 32 | # Human-readable table (default) |
| 33 | sapcli datapreview osql "SELECT * FROM T000" |
| 34 | |
| 35 | # JSON output — useful for scripting or piping to jq |
| 36 | sapcli datapreview osql -o json "SELECT * FROM T000" |
| 37 | ``` |
| 38 | |
| 39 | ## Suppress headings |
| 40 | |
| 41 | Use `-n` / `--noheadings` to omit column headers from the output: |
| 42 | |
| 43 | ```bash |
| 44 | sapcli datapreview osql -n "SELECT MANDT FROM T000" |
| 45 | ``` |
| 46 | |
| 47 | ## Disable aging check |
| 48 | |
| 49 | Use `--noaging` to skip the data aging check: |
| 50 | |
| 51 | ```bash |
| 52 | sapcli datapreview osql --noaging "SELECT * FROM SFLIGHT UP TO 5 ROWS" |
| 53 | ``` |
| 54 | |
| 55 | ## Notes |
| 56 | |
| 57 | - The `statement` argument must be valid ABAP SQL syntax **without** a trailing period. |
| 58 | - Only SELECT statements (no JOINS) are supported via `datapreview osql`. |