sap
Integrate with SAP systems and build extensions. Use when a user asks to connect to SAP S/4HANA, SAP Business One, or SAP ERP via OData, RFC, BAPI, or IDoc interfaces, build SAP BTP (Business Technology Platform) applications, work with SAP CAP (Cloud Application Programming), consume SAP APIs from the API Business Hub, manage master data, automate procurement or sales processes, build Fiori apps, extract SAP data for analytics, or integrate SAP with external systems. Covers S/4HANA APIs, Business One, BTP, CAP, and integration patterns.
What this skill does
# SAP
## Overview
Integrate with SAP — the enterprise ERP backbone. This skill covers SAP S/4HANA Cloud and on-premise APIs (OData V2/V4, BAPI/RFC), SAP Business One (Service Layer), SAP BTP application development, SAP CAP (Cloud Application Programming model), SAP Cloud SDK for JavaScript/TypeScript, master data management, procurement and sales document automation, and integration patterns for connecting SAP with external systems.
## Instructions
### Step 1: Authentication & Connectivity
**S/4HANA Cloud — OAuth2 Client Credentials:**
```bash
export SAP_TOKEN_URL="https://your-tenant.authentication.eu10.hana.ondemand.com/oauth/token"
export SAP_CLIENT_ID="client-id"
export SAP_CLIENT_SECRET="client-secret"
export SAP_BASE_URL="https://my-s4hana.com/sap/opu/odata/sap"
```
```typescript
async function getSAPToken() {
const res = await fetch(process.env.SAP_TOKEN_URL!, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Basic " + Buffer.from(`${SAP_CLIENT_ID}:${SAP_CLIENT_SECRET}`).toString("base64"),
},
body: "grant_type=client_credentials",
});
return (await res.json()).access_token;
}
async function sapApi(method: string, path: string, token: string, body?: any) {
const res = await fetch(`${process.env.SAP_BASE_URL}${path}`, {
method,
headers: {
Authorization: `Bearer ${token}`, "Content-Type": "application/json", Accept: "application/json",
...(method !== "GET" ? { "X-CSRF-Token": await getCSRFToken(token) } : {}),
},
body: body ? JSON.stringify(body) : undefined,
});
if (!res.ok) throw new Error(`SAP ${res.status}: ${await res.text()}`);
return res.json();
}
```
**SAP Business One — Service Layer:**
```typescript
const B1_URL = "https://your-b1-server:50000/b1s/v1";
async function b1Login() {
const res = await fetch(`${B1_URL}/Login`, {
method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ CompanyDB: "SBODemoUS", UserName: "manager", Password: "password" }),
});
return res.headers.get("set-cookie"); // Session cookie
}
async function b1Api(method: string, path: string, session: string, body?: any) {
const res = await fetch(`${B1_URL}${path}`, {
method, headers: { "Content-Type": "application/json", Cookie: session },
body: body ? JSON.stringify(body) : undefined,
});
return res.json();
}
```
### Step 2: S/4HANA OData APIs
**Business Partners:**
```typescript
const customers = await sapApi("GET",
"/API_BUSINESS_PARTNER/A_BusinessPartner?$filter=BusinessPartnerCategory eq '1'&$select=BusinessPartner,BusinessPartnerFullName,Industry&$top=50", token);
await sapApi("POST", "/API_BUSINESS_PARTNER/A_BusinessPartner", token, {
BusinessPartnerCategory: "1", BusinessPartnerFullName: "TechStart GmbH",
SearchTerm1: "TECHSTART", Industry: "IT",
to_BusinessPartnerAddress: [{ Country: "DE", CityName: "Berlin", StreetName: "Friedrichstraße", HouseNumber: "123", PostalCode: "10117" }],
});
```
**Sales Orders:**
```typescript
await sapApi("POST", "/API_SALES_ORDER_SRV/A_SalesOrder", token, {
SalesOrderType: "OR", SalesOrganization: "1010", DistributionChannel: "10",
SoldToParty: "CUSTOMER_BP_ID", PurchaseOrderByCustomer: "PO-2026-001",
to_Item: [
{ Material: "TG11", RequestedQuantity: "10", RequestedQuantityUnit: "EA", NetPriceAmount: "100.00", NetPriceCurrency: "EUR" },
{ Material: "TG12", RequestedQuantity: "5", RequestedQuantityUnit: "EA", NetPriceAmount: "250.00", NetPriceCurrency: "EUR" },
],
});
```
**Purchase Orders & Material Master:**
```typescript
await sapApi("POST", "/API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder", token, {
PurchaseOrderType: "NB", CompanyCode: "1010", Supplier: "VENDOR_BP_ID",
to_PurchaseOrderItem: [{ Material: "RAW-001", OrderQuantity: "1000", PurchaseOrderQuantityUnit: "KG",
NetPriceAmount: "5.50", DocumentCurrency: "EUR", Plant: "1010" }],
});
const material = await sapApi("GET", "/API_PRODUCT_SRV/A_Product('TG11')?$expand=to_Description,to_Plant", token);
```
### Step 3: SAP Business One Operations
```typescript
// Sales order → invoice → payment flow
const order = await b1Api("POST", "/Orders", session, {
CardCode: "C20000", DocDate: "2026-02-18",
DocumentLines: [
{ ItemCode: "A00001", Quantity: 10, UnitPrice: 100 },
{ ItemCode: "A00002", Quantity: 5, UnitPrice: 250 },
],
});
const invoice = await b1Api("POST", "/Invoices", session, {
CardCode: "C20000",
DocumentLines: [
{ BaseType: 17, BaseEntry: order.DocEntry, BaseLine: 0 },
{ BaseType: 17, BaseEntry: order.DocEntry, BaseLine: 1 },
],
});
await b1Api("POST", "/IncomingPayments", session, {
CardCode: "C20000", DocDate: "2026-02-18", CashSum: 1750,
PaymentInvoices: [{ DocEntry: invoice.DocEntry, SumApplied: 1750, InvoiceType: "it_Invoice" }],
});
```
### Step 4: SAP CAP (Cloud Application Programming)
```bash
npm install -g @sap/cds-dk
cds init my-project && cd my-project && npm install
```
**Data model** (`db/schema.cds`):
```cds
namespace my.project;
entity Products { key ID: UUID; name: String(100); price: Decimal(10,2); stock: Integer; category: Association to Categories; }
entity Categories { key ID: UUID; name: String(50); products: Association to many Products on products.category = $self; }
entity Orders { key ID: UUID; orderDate: Date; customer: String(100); status: String(20) default 'New';
items: Composition of many OrderItems on items.order = $self; totalAmount: Decimal(12,2); }
entity OrderItems { key ID: UUID; order: Association to Orders; product: Association to Products; quantity: Integer; unitPrice: Decimal(10,2); }
```
**Service logic** (`srv/catalog-service.js`):
```javascript
const cds = require("@sap/cds");
module.exports = class CatalogService extends cds.ApplicationService {
init() {
const { Products, Orders } = this.entities;
this.before("CREATE", Orders, async (req) => {
for (const item of req.data.items) {
const product = await SELECT.one.from(Products).where({ ID: item.product_ID });
if (!product) throw req.reject(404, `Product ${item.product_ID} not found`);
if (product.stock < item.quantity) throw req.reject(409, `Insufficient stock for ${product.name}`);
item.unitPrice = product.price;
}
req.data.totalAmount = req.data.items.reduce((s, i) => s + i.unitPrice * i.quantity, 0);
});
this.after("CREATE", Orders, async (order) => {
for (const item of order.items)
await UPDATE(Products).set({ stock: { "-=": item.quantity } }).where({ ID: item.product_ID });
});
return super.init();
}
};
```
Run locally: `cds watch` → API at `http://localhost:4004/catalog`.
### Step 5: Integration Patterns
**SAP → External (polling):**
```typescript
import cron from "node-cron";
let lastCheck = new Date().toISOString();
cron.schedule("*/5 * * * *", async () => {
const token = await getSAPToken();
const orders = await sapApi("GET",
`/API_SALES_ORDER_SRV/A_SalesOrder?$filter=CreationDate gt datetime'${lastCheck}'&$expand=to_Item`, token);
for (const order of orders.d.results) {
await externalApi.createOrder({ sapOrderId: order.SalesOrder, customer: order.SoldToParty,
items: order.to_Item.results.map((i: any) => ({ material: i.Material, quantity: parseFloat(i.OrderQuantity) })),
});
}
lastCheck = new Date().toISOString();
});
```
**External → SAP (Shopify webhook):**
```typescript
app.post("/webhook/shopify/order", async (req, res) => {
const token = await getSAPToken();
const items = req.body.line_items.map((item: any) => ({
Material: item.sku, RequestedQuantity: String(item.quantity),
NetPriceAmount: String(item.price), NetPriceCurrency: req.body.currency,
}));
await sapApi("POST", "/API_SALES_ORDER_SRV/A_SalesOrder", token, {
SalesOrderType: "OR", SalesOrganization: "1010", DistributionChannel: "10",
SoldToParty: "CUSTOMER_BP_ID", to_Item: items,
});
res.sendRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.