SAP Analytics Cloud: A Developer's Guide
SAP Analytics Cloud (SAC) is SAP's unified, cloud-based platform for business intelligence, planning, and predictive analytics. Rather than splitting reporting, budgeting, and forecasting across separate tools, SAC brings them together in a single SaaS application backed by SAP HANA's in-memory engine. For developers, SAC is interesting because it offers a real scripting API, a planning model with versioning and allocation, and an extension point for custom web-component widgets — capabilities that go well beyond drag-and-drop dashboard building.
This guide covers SAC from a developer's perspective: the analytics surface, the planning engine, custom development options (scripting and widgets), and how AI coding assistants can help when they have the right context.
What is SAP Analytics Cloud?
SAC is SAP's cloud analytics and planning product, bringing BI, planning, and predictive capabilities into one SaaS tenant:
- Analytics (BI) — stories, dashboards, and analytical applications on live or imported data.
- Planning — driver-based budgeting, forecasting, and what-if analysis on versioned planning models.
- Predictive — regression, classification, and time-series forecasting built into the platform.
Data arrives from SAC's own models (flat-file import or the Data Export Service), from live connections to SAP S/4HANA, SAP BW/4HANA, and SAP HANA, or from SAP Datasphere, the federated semantic layer for many SAC deployments. The common reference architecture is: source systems → Datasphere (modeling, federation, replication) → SAC (consumption, planning, dashboards).
Analytics Capabilities
The analytics side of SAC is where most users start. The primary building blocks are:
- Stories — multi-page documents combining charts, tables, filters, text, and geo maps. The newer Optimized Story Experience (OSE) is now the default runtime and replaces classic story mode.
- Analytical Applications (Analytics Designer) — scriptable applications with full control over layout, interactivity, and business logic. This is where developer work happens.
- Dashboards — simplified tile-based overviews, often surfaced in SAP Build Work Zone or embedded into S/4HANA.
Analytics Designer is the most relevant surface for developers. It exposes a type-checked scripting language (syntactically similar to JavaScript) and a rich widget API: Chart, Table, InputField, DropDown, Dimension, DataSource, and more. You attach scripts to widget events (onInitialize, onSelect, onResultChanged) to drive interactivity, drill-downs, and conditional formatting that the no-code story builder cannot express.
// Example: filter a chart based on a dropdown selection (Analytics Designer API)
Dropdown_1.onSelect = function() {
var region = Dropdown_1.getSelectedKey();
Chart_1.getDataSource().setDimensionFilter("Region", region);
};
For simple BI consumption, stories are enough. For anything resembling a custom application — guided navigation, dynamic visibility, complex calculations reacting to user input — Analytics Designer is the right tool.
Planning
Planning is what distinguishes SAC from a pure BI tool. A SAC planning model holds transactional data organized into versions: a public Actual version fed from source systems, plus public or private planning versions where finance teams enter budget, forecast, or scenario data. Writes to planning versions never touch actuals, which makes what-if analysis safe by construction.
Key developer-facing planning primitives:
- Data Actions — scriptable, sequenced steps for copying, allocating, and transforming data across versions and dimensions. Support advanced functions like allocation by reference, distribution by driver, and cross-model calculations.
- Multi Actions — orchestrate multiple data actions (and predictive forecasts) into a single executable, often scheduled.
- Value Driver Trees — visual what-if analysis where users tweak leaf-node drivers and watch the roll-up recalculate.
- Data Locking — cell-level or hierarchy-level locks preventing edits once a planning slice is finalized.
- Planning Workflows / Calendar — approval flows routing a planning version through reviewers before publication.
The scripting API mirrors these capabilities. PlanningModel, getPlanning(), and the DataSource planning extension give programmatic access to versions, data actions, and locking — useful when automating planning steps or building custom planning entry screens.
// Trigger a data action from an Analytics Designer button
Button_RunCopy.onPress = function() {
var dataAction = DataAction_CopyActuals;
dataAction.execute().then(function(result) {
if (result.status === "Success") {
Application.refreshData();
}
});
};
Because the planning API surface is large and SAP-specific, this is one area where accurate reference material matters a great deal — getting the version ID, member filter syntax, or async handling wrong produces silent failures.
Custom Development (Scripting & Widgets)
Beyond built-in charts and tables, SAC offers two extension mechanisms that developers should know about.
SAC Scripting (Analytics Designer)
The scripting API is the primary way to add logic to an analytical application or optimized story. Scripts are written in a JavaScript-based language in the SAC script editor and use SAP-specific objects, methods, events, and planning APIs. Typical use cases:
- Conditional interactivity — show/hide widgets, swap chart types, navigate between pages based on selections.
- Custom calculations — derive measures that standard calculated measures cannot express.
- Planning automation — chain data actions, validate input before write-back, trigger version copies from a button.
- Embedded navigation — launch external URLs, deep-link into S/4HANA apps, pass filter context between SAC stories.
SAC Custom Widgets
When the built-in visualization catalog is not enough, SAC Custom Widgets let you package any web component as a first-class SAC widget. A custom widget is a ZIP containing:
- A
JSONmetadata file describing the widget's properties, feeds, events, methods, and builder panel. - A JavaScript implementation as a standard web component (using the Custom Elements API).
- Optional third-party libraries (Chart.js, D3, mapping SDKs, etc.) bundled in.
Custom widgets integrate with SAC's data binding via feeds (dimensions and measures), participate in the application's filter context, and expose properties in the builder panel for non-developers to configure. The Widget Add-On mechanism (available since QRC Q4 2023) lets administrators register widgets tenant-wide rather than per-application.
Common widget use cases: specialized chart types (Sankey, Gantt, network graphs), branded KPI cards, third-party mapping providers, and proprietary visualizations that would never ship as a standard SAC chart.
AI-Assisted SAC Development
SAC's scripting API and widget SDK are large, version-evolving, and SAP-unique. Generic AI assistants can write plausible-looking SAC code that quietly uses the wrong API signature, misnames a planning method, or targets an outdated widget contract. This is exactly where curated skill context helps.
A well-structured SAC skill gives an AI assistant:
- Correct Analytics Designer / Optimized Story Experience API surface, including deprecated vs. active methods.
- Correct planning API patterns:
getPlanning(),PlanningModel, version handling, async data action execution. - The custom widget contract: JSON metadata schema, web component lifecycle, feed binding, builder panel conventions, Widget Add-On packaging.
- SAP Datasphere integration context for source models and live connections.
With that context loaded, an assistant can reliably scaffold a planning application, generate a custom widget skeleton, write data action automation scripts, and debug DataSource filter bugs — work that would otherwise require constant cross-checking against SAP Help Portal.
Install the relevant skills to give your assistant this context:
npx skills add secondsky/sap-skills --skill sap-sac-scripting
npx skills add secondsky/sap-skills --skill sap-sac-planning
npx skills add secondsky/sap-skills --skill sap-sac-custom-widget
npx skills add secondsky/sap-skills --skill sap-datasphere
These four cover the bulk of SAC development work: the scripting API, the planning engine, custom widget authoring, and the Datasphere data layer that typically feeds SAC. For teams working across the full SAP analytics stack, installing all of them at once gives an AI assistant enough context to handle end-to-end analytics and planning scenarios without hallucinating SAP-proprietary APIs.