client/media/skills/sap-data-workbook/SKILL.md
Create SAP Data Workbooks (.sapwb) for SAP data analysis. Use when the user asks to analyze SAP data, create data quality checks, build reports, compare tables, profile data, or any multi-step SAP data exploration. Workbooks have ABAP SQL cells (queries against SAP) and JavaScript cells (process results). They save as files and can be re-run.
npx skillsauth add marcellourbani/vscode_abap_remote_fs sap-data-workbookInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You create .sapwb files — VS Code notebooks with ABAP SQL and JavaScript cells that query SAP and process results. The user opens the file and clicks "Run All."
Create a workbook when the user wants to:
Mandatory: You MUST follow steps 1→2→3 in order. Do NOT create the file with any cells. Do NOT skip the read-back step.
.sapwb file with ONLY metadata and an empty cells array: {"version": 1, "title": "Your Title", "cells": []}"abap-sql" for SQL cells (NOT "sql"), "javascript" for JS cells, and "markdown" for markdown cells..sapwb files are JSON:
{
"version": 1,
"title": "Descriptive Title",
"cells": [
{ "type": "markdown", "content": "# Title\nExplanation" },
{ "type": "abap-sql", "content": "SELECT matnr, mtart FROM mara WHERE mtart = 'FERT'" },
{ "type": "javascript", "content": "const rows = cells[1].result;\nreturn rows.map(r => ({ MATNR: r.MATNR, MTART: r.MTART }));" },
{ "type": "abap-sql", "content": "SELECT matnr, werks FROM marc WHERE matnr = ${cells[2].result[0].MATNR}" }
]
}
Get ABAP SQL syntax. Call get_abap_sql_syntax before writing SQL cells. ABAP SQL differs from standard SQL (tilde for table~field, no semicolons, etc.).
Cell types are exactly: "abap-sql", "javascript", or "markdown". No other values.
SQL cells execute ABAP SQL via ADT. Only SELECT and WITH are allowed. No DML. No semicolons.
JavaScript cells run in an isolated worker thread. They access previous cell results via cells[N].result:
cells[N] is 0-based and includes ALL cells (markdown, SQL, and JS). A workbook starting with a markdown cell means the first SQL cell is cells[1], not cells[0].[{FIELD1: "val", FIELD2: "val"}, ...]return <value>. A JS cell with no return outputs undefined. Use return null if no value is needed.console.log() appears as diagnostic output above the result — do not rely on it for primary output.SQL interpolation: SQL cells can reference previous results with ${cells[N].result.path}. This resolves before execution. Strings are single-quoted automatically — do NOT add your own quotes around interpolation expressions. Arrays are joined with commas (each element auto-quoted). Numbers are inserted bare.
SAP 255-character SQL literal limit. SAP ADT rejects any SQL where a single literal exceeds 255 characters. This means interpolating large arrays into IN (...) clauses WILL FAIL. Never interpolate arrays that could have more than ~10 values into SQL. Instead, use a JavaScript cell to loop in small batches and filter the results programmatically. For example, instead of SELECT ... WHERE matnr IN (${cells[1].result.ids}), write a JS cell that takes the full result set and filters it using cells[1].result.
maxRows is optional per SQL cell (default 1000). Set it to however many rows the user needs. This maps directly to ADT's maxRows parameter: { "type": "abap-sql", "content": "...", "maxRows": 50000 }
Start every workbook with a markdown cell explaining what it does.
File path: Write to the user's workspace root or a workbooks/ subfolder.
// Access SQL results (array of row objects)
const allRows = cells[1].result; // full array
const firstRow = cells[1].result[0]; // first row
const value = cells[1].result[0].MATNR; // specific field
// Access JS cell results
const count = cells[2].result; // if cell 2 returned a number
const obj = cells[2].result.vendorIds; // if cell 2 returned an object
// Use in SQL interpolation (quotes added automatically for strings — do NOT wrap in quotes)
// "SELECT ... WHERE matnr = ${cells[2].result}"
// "SELECT ... WHERE lifnr IN (${cells[3].result.ids})" -- arrays auto-join with commas
{
"version": 1,
"title": "Material Master Data Quality Check",
"cells": [
{
"type": "markdown",
"content": "# Material Master Data Quality\nChecks for materials missing descriptions, invalid UoM, and orphaned records."
},
{
"type": "abap-sql",
"content": "SELECT matnr, mtart, matkl, meins FROM mara WHERE ersda > '20250101'"
},
{
"type": "javascript",
"content": "const materials = cells[1].result;\nconst noUoM = materials.filter(m => !m.MEINS || m.MEINS.trim() === '');\nconst noGroup = materials.filter(m => !m.MATKL || m.MATKL.trim() === '');\nreturn {\n total: materials.length,\n missingUoM: noUoM.length,\n missingGroup: noGroup.length,\n issues: [...noUoM.slice(0, 10), ...noGroup.slice(0, 10)]\n};"
},
{
"type": "markdown",
"content": "## Results Summary\nThe JavaScript cell above returns counts and sample issues. Review the output for materials that need attention."
}
]
}
tools
Investigate SAP ADT REST API endpoints. Use when the user asks about ADT API endpoints, request/response XML formats, content types, or how a specific ADT feature works under the hood. Teaches how to trace from discovery documents → RES_APP classes → handler classes → Simple Transformations → XML schemas. Requires the adt_discovery_export tool output files and standard ABAP tools (get_abap_object_lines, search_abap_objects, search_abap_object_lines).
development
Generate a comprehensive SAP System Personality Report. Analyzes custom code landscape, functional footprint, development activity, health metrics, and package breakdown. Use when a user asks to characterize a system, understand a system, get a system overview, system report, system personality, or "what does this system do?" Collects data via SQL queries and presents results in a structured webview.
data-ai
Navigate and understand SAP Customizing (SPRO/IMG). Use when the user asks about customizing settings, SPRO activities, configuration tables, maintenance views, view clusters, or needs to read/understand any customizing data. This skill teaches how to systematically trace from an SPRO activity to the actual tables where config data is stored, and how to find the SPRO menu path for any activity. Load this skill whenever customizing, SPRO, IMG, configuration, or settings maintenance is involved.
development
Clean ABAP coding standards and best practices. Use when writing ABAP code, reviewing ABAP code, or refactoring ABAP code to ensure it follows SAP's official Clean ABAP style guide. Covers naming conventions, modern language constructs, class/method design, error handling, formatting, comments, and unit testing patterns.