sap-sac-scripting

Write and debug JavaScript scripts for SAP Analytics Cloud Analytics Designer and Optimized Story Experience.

Updated May 18, 2026
One-click install
npx skills add https://github.com/Melik1986/axon-erp-api --skill sap-sac-scripting-melik1986
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sap-sac-scripting
Source: https://github.com/Melik1986/axon-erp-api/tree/main/cursor/skills/sap-sac-scripting
Command: npx skills add https://github.com/Melik1986/axon-erp-api --skill sap-sac-scripting-melik1986

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developing interactive SAP Analytics Cloud applications and stories requires navigating two distinct scripting APIs (Analytics Designer and Optimized Story Experience), and developers often struggle to find correct API methods, debug runtime errors, and apply performance best practices without deep documentation searches. ## Core Features & Use Cases - Dual-Environment API Guidance: Detects whether you work in Analytics Designer or Optimized Story Experience and routes to the correct API reference set (66 reference files covering DataSource, Planning, Chart, Table, Calendar, and Bookmark APIs). - Ready-to-Use Script Patterns: Provides 56 templates for common operations like dimension filtering, version publishing, data locking, navigation, and export handlers. - Specialized Agents and Commands: Includes agents for script debugging, performance optimization, planning assistance, and API lookup, plus commands like /sac-debug and /sac-script-template. - Use Case: A developer building a planning story needs to filter a table by the selected chart member and publish a private version; the skill supplies the exact getSelections(), setDimensionFilter(), and publish() patterns with performance-safe batching via setRefreshPaused(). ## Quick Start Ask the assistant to write a SAC script that filters Table_1 based on the selected member of Chart_1, specifying whether you use Analytics Designer or Optimized Story Experience.

Frequently Asked Questions about sap-sac-scripting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a script in SAP Analytics Cloud Analytics Designer?▼

Open the application in Edit mode, select a widget, and add scripts in the Scripts tab for events like onInitialization or onSelect. Scripts use a typed JavaScript subset, for example calling Chart_1.getSelections() and Table_1.getDataSource().setDimensionFilter() to link widgets.

What is the difference between Analytics Designer and Optimized Story Experience scripting?▼

Analytics Designer uses the full application API for analytic applications, while Optimized Story Experience uses the OSE API (v2025.20) for story-based scripting in Advanced Mode. The correct API reference must be chosen per environment because method availability differs.

How do I filter SAC data with setDimensionFilter?▼

Call setDimensionFilter on a widget's DataSource with a dimension ID and value, supporting single values, multiple values, exclude flags, and range filters on numeric dimensions. Pause refresh with setRefreshPaused(true) before applying multiple filters to avoid repeated backend calls.

Does SAC scripting support planning version management?▼

Yes, the Planning API accessed via Table.getPlanning() supports getPublicVersion(), getPrivateVersion(), publish(), copyFromPublicVersion(), and setLock() for data locking. Version management APIs are unsupported for BPC writeback-enabled versions, where UI publish tools must be used instead.

Why is my SAC script slow or triggering too many refreshes?▼

Each setDimensionFilter call triggers a backend refresh unless refresh is paused. Batch operations between setRefreshPaused(true) and setRefreshPaused(false), prefer cached getResultSet() over getMembers(), and keep onInitialization empty to improve load performance.

How do I debug SAC scripts in the browser?▼

Use console.log statements and open Chrome or Edge DevTools (F12), filtering the Console by Info type and inspecting sandbox.worker.main scripts. Add ?debug=true or ?APP_PERFORMANCE_LOGGING=true to the URL, or use the debugger statement for breakpoints.