Skip to content
Development
Command

/sac-script-template

Template type: filter, planning, export, navigation, chart, table, dropdown, popup, timer, bookmark

From plugin
sap-skills
40469 skills31 agents69 commands8 MCP
Install
$ npx -y skills add secondsky/sap-skills --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/sac-script-template

Context preview

What this command does when you run it.

Template type: filter, planning, export, navigation, chart, table, dropdown, popup, timer, bookmark

Command definition

sac-script-template.md
name: sac-script-template
description: Generate SAC script templates for common Analytics Designer and Optimized Story Experience scenarios
allowed-tools:
  - Read
argument-hint: "<filter|planning|export|navigation|chart|table|dropdown|popup|timer|bookmark>"
arguments:
  - name: type
    description: "Template type: filter, planning, export, navigation, chart, table, dropdown, popup, timer, bookmark"
    required: true

Shell Snippet Notes

  • Shell snippets assume Bash on Linux/macOS, WSL2, or Git Bash.
  • Install the command-specific tooling shown near each snippet before running it.
  • Confirm before running commands that delete files, change ownership, deploy, or modify remote systems.

Output Contract

Return a script template, required widget/model assumptions, API references, and validation notes. Default to generating text only unless the user explicitly asks to write files and confirms the target path.

Generate a SAC script template based on the requested type.

Available Template Types

filter

Cross-widget filtering pattern with selection handling and data source synchronization.

planning

Planning operations template including version management, publish, and copy operations.

export

PDF and PowerPoint export functionality with custom settings.

navigation

Story-to-story navigation with URL parameters.

chart

Chart manipulation including measure/dimension changes and selection handling.

table

Table configuration with rows, columns, totals, and zero suppression.

dropdown

Dropdown/Input Control handling with selection events.

popup

Popup management with open/close and data passing.

timer

Timer-based auto-refresh and scheduled operations.

bookmark

Bookmark creation, application, and management.

---

Template: filter

/*
 * Cross-Widget Filter Pattern
 * Purpose: Apply selection from source widget to target widget
 * Trigger: onSelect event on source Chart/Table
 */

// Get selections from the source widget
var selections = Chart_Source.getSelections();

if (selections.length > 0) {
    // Extract the dimension value from selection
    var selectedValue = selections[0]["Location"]; // Adjust dimension name

    // Get target data source
    var targetDS = Table_Target.getDataSource();

    // Apply filter
    targetDS.setDimensionFilter("Location", selectedValue);

    // For multiple values
    // var values = selections.map(function(sel) { return sel["Location"]; });
    // targetDS.setDimensionFilter("Location", values);
}

---

Template: planning

/*
 * Planning Version Management Pattern
 * Purpose: Publish private version to public
 * Trigger: onClick event on Publish button
 */

var planning = Table_Planning.getPlanning();

Application.showBusyIndicator("Publishing data...");

try {
    // Check for private version
    var privateVersion = planning.getPrivateVersion();

    if (privateVersion !== null) {
        // Publish to public version
        planning.publish();

        Application.showMessage(
            ApplicationMessageType.Success,
            "Data published successfully"
        );

        // Refresh the view
        Table_Planning.getDataSource().refreshData();
    } else {
        Application.showMessage(
            ApplicationMessageType.Warning,
            "No private version to publish"
        );
    }
} catch (e) {
    Application.showMessage(
        ApplicationMessageType.Error,
        "Publish failed: " + e.message
    );
} finally {
    Application.hideBusyIndicator();
}

---

Template: export

/*
 * PDF Export Pattern
 * Purpose: Export current view to PDF
 * Trigger: onClick event on Export button
 */

// Configure export settings
var exportSettings = {
    fileName: "Report_" + new Date().toISOString().split('T')[0],
    paperSize: PaperSize.A4,
    orientation: Orientation.Landscape,
    includeFilters: true,
    fitToPage: true
};

// Execute PDF export
Application.exportToPDF(exportSettings);

// For PowerPoint export
// var pptSettings = {
//     fileName: "Presentation",
//     includeInputControls: false
// };
// Application.exportToPPT(pptSettings);

---

Template: navigation

/*
 * Story Navigation Pattern
 * Purpose: Navigate to another story with parameters
 * Trigger: onClick event on Navigation button
 */

// Create URL parameters
var urlParameters = ArrayUtils.create(Type.UrlParameter);
urlParameters.push(UrlParameter.create("page", "dashboard"));
urlParameters.push(UrlParameter.create("filter", Dropdown_1.getSelectedKey()));

// Navigate to target story
// Replace STORY_ID with actual story ID from URL
NavigationUtils.openStory(
    "STORY_ID_HERE",  // Target story ID
    "",               // Empty for same folder
    urlParameters,    // Parameters to pass
    false            // false = same tab, true = new tab
);

---

Template: chart

/*
 * Chart Manipulation Pattern
 * Purpose: Dynamically modify chart configuration
 * Trigger: onChange event on control or onClick on button
 */

// Add/Remove measures
Chart_1.addMeasure("Revenue", Feed.ValueAxis);
Chart_1.removeMeasure("Cost");

// Add/Remove dimensions
Chart_1.addDimension("Region", Feed.CategoryAxis);
Chart_1.removeDimension("Product");

// Get current selections
var selections = Chart_1.getSelections();
console.log("Selected:", JSON.stringify(selections));

// Handle selection in onSelect
if (selections.length > 0) {
    var selectedDimValue = selections[0]["Region"];
    // Do something with selection
}

---

Template: table

/*
 * Table Configuration Pattern
 * Purpose: Configure table display properties
 * Trigger: onInitialization or button click
 */

// Configure dimensions and measures
Table_1.addDimensionToRows("Location");
Table_1.addDimensionToRows("Product");
Table_1.addMeasure("Revenue");
Table_1.addMeasure("Quantity");

// Display settings
Table_1.setTotalsVisible(true);
Table
Read more
Ships withsap-skills

40 SAP development plugins with evidence-tracked verification SAP development plugins for AI coding assistants, with public-source or package-registry verification tracked where available.

Get the whole plugin