Comprehensive SAC scripting skill for SAP Analytics Cloud Analytics Designer and Optimized Story Experience...
Comprehensive skill for scripting in SAP Analytics Cloud (SAC) Analytics Designer and Optimized Story Experience.
When the user invokes this skill with no specific task (e.g. "help with SAC scripting", "use SAC scripting skill", or no follow-up question), respond with this structured orientation:
Welcome! I can help you with SAP Analytics Cloud scripting.
First, which environment are you working in?
- Analytics Designer — application-based scripting, full API
- Optimized Story Experience — story-based scripting, OSE API (v2025.14)
Then, what do you need help with?
- Write a new script (filter, planning, navigation, export...)
- Debug an existing script
- Optimize performance
- Find the right API method
- Planning operations (version management, data locking...)
This plugin provides specialized tools for SAC development:
Agents (use via Task tool):
sac-script-debugger - Debug script errors, trace issuessac-performance-optimizer - Analyze and fix performance bottleneckssac-planning-assistant - Guide planning operations and version managementsac-api-helper - Find correct APIs and provide code examplesCommands (use via /command):
/sac-script-template - Generate script templates (filter, planning, export, etc.)/sac-debug - Interactive debugging guidance/sac-optimize - Performance analysis and recommendations/sac-planning - Planning operation templatesHooks:
This plugin ships with a .mcp.json that connects to the community sap_analytics_cloud_mcp
server, exposing 90 SAC REST API tools across 11 service areas (Content, Data Export, Data Import,
Multi Actions, Calendar, Content Transport, User Management, Monitoring, Schedule & Publication,
Translation, Smart Query).
Before using MCP tools, check if the server is already installed:
.claude/sac-mcp.local.md in the projectSAC_MCP_PATH is set in the environmentIf not installed, ask the user once: "Would you like help setting up the SAC MCP server?"
If yes, guide them through:
Clone and build:
git clone https://github.com/secondsky/sap_analytics_cloud_mcp
cd sap_analytics_cloud_mcp && npm install && npm run build
Configure environment variables:
SAC_MCP_PATH — absolute path to the cloned repo (e.g. /home/user/sap_analytics_cloud_mcp)SAC_BASE_URL — SAC tenant root URL (e.g. https://mytenant.eu10.hanacloudservices.cloud.sap)SAC_TOKEN_URL — OAuth token endpointSAC_CLIENT_ID / SAC_CLIENT_SECRET — from SAC OAuth client configurationAfter successful install, write .claude/sac-mcp.local.md (gitignored) with:
# SAC MCP Installation Record
- Installed: [date]
- Path: [absolute path to build/index.js]
- Env vars configured: SAC_MCP_PATH, SAC_BASE_URL, SAC_TOKEN_URL, SAC_CLIENT_ID, SAC_CLIENT_SECRET
This prevents re-prompting in future sessions.
Key scripting enhancements in the latest SAC release:
See references/whats-new-q1-2026.md for complete details.
Before writing or analyzing any script, identify which SAC environment the user is working in.
Detection signals:
| Signal | Environment |
|---|---|
Mentions .story, "Optimized Story", OSE, Story., Application.getActivePage() |
OSE |
Mentions Analytics Designer, AnalyticApplication, Designer, .application |
Analytics Designer |
| Says "SAC script" / "my script" without further context | Unclear |
When environment is unclear, ask ONE concise question before proceeding:
"Are you scripting in Analytics Designer or Optimized Story Experience? This determines which API reference I use."
Do not ask again after the user answers.
After confirmation, use the correct references:
references/ose-api-*.md (8 files, Q1 2026, v2025.14)references/api-*.md (existing files)// Event handler example (onSelect on Chart_1)
var selections = Chart_1.getSelections();
if (selections.length > 0) {
var selectedValue = selections[0]["Location"];
Table_1.getDataSource().setDimensionFilter("Location", selectedValue);
}
Access via Widget.getDataSource(). Key methods:
getMembers(dim, {accessMode: MemberAccessMode.BookedValues}) - Get dimension members efficientlygetResultSet() - Cached data access (preferred over getData())setDimensionFilter(dim, value) - Apply filterssetRefreshPaused(true/false) - Batch multiple operationsAccess via Table.getPlanning(). Key operations:
getPublicVersion() / getPrivateVersion() - Version accesspublish() - Submit private to publiccopyFromPublicVersion() / copyToPublicVersion() - Data copysetLock(true/false) - Data lockingaddMeasure(), addDimension(), getSelections()addDimensionToRows(), setZeroSuppressionEnabled()Global utilities:
Application.showBusyIndicator() / hideBusyIndicator()Application.showMessage(type, text)Application.getUserInfo() / getInfo()Minimize Backend Calls
// Use getResultSet() (cached) instead of getMembers() (backend)
var data = ds.getResultSet();
Batch Filter Operations
ds.setRefreshPaused(true);
ds.setDimensionFilter("Dim1", value1);
ds.setDimensionFilter("Dim2", value2);
ds.setRefreshPaused(false); // Single refresh
Keep onInitialization Empty Defer heavy operations to lazy loading or first interaction.
Use BookedValues for Members
var members = ds.getMembers("Dim", {accessMode: MemberAccessMode.BookedValues});
console.log("Debug:", myVariable);
console.log("Selections:", JSON.stringify(Chart_1.getSelections()));
?APP_PERFORMANCE_LOGGING=true to URL for timingReference Files (63 files):
references/api-datasource.md, references/api-widgets.md, references/api-planning.mdreferences/api-calendar-bookmarks.md, references/api-advanced-widgets.mdreferences/best-practices-developer.md, references/best-practices-planning-stories.mdreferences/scripting-language-fundamentals.mdreferences/whats-new-q1-2026.md, references/chart-variance-apis.mdreferences/ose-api-application-core.md — Application, PageBook, Panel, Popup, Widget (15 classes)references/ose-api-widgets.md — Button, Dropdown, InputField, Slider, Switch, Text, TextArea (15 classes)references/ose-api-datasource.md — DataSource, DataAction, DataBinding, DataLocking, DataChangeInsights (39 classes)references/ose-api-chart-viz.md — Chart, Table, GeoMap, RVisualization, ValueDriverTree (20 classes)references/ose-api-planning-calendar.md — Planning, PlanningModel, all Calendar classes (54 classes)references/ose-api-filtering-selection.md — FilterLine, FilterValue, Selection (11 classes)references/ose-api-utilities.md — BookmarkSet, MemberInfo, DimensionInfo, Timer, NavigationUtils (37 classes)references/ose-api-types-enums.md — All enum types: Feed, Layout, NumberFormat, VariableValue (70 classes)Templates (56 patterns):
templates/common-patterns.js - 40 general scripting patternstemplates/planning-operations.js - 16 planning-specific patternsVersion: 3.0.1 | Last Verified: 2026-03-07 | SAC Version: Q1 2026 (2026.2) | API Version: 2025.14