From 6942e32e6be7d4a4c9a6a4d0890142d6fc896b4d Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:55:02 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 + README.md | 3 + SKILL.md | 433 ++++++++++++++++++++++++++++++ plugin.lock.json | 133 ++++++++++ references/abap-cloud.md | 407 ++++++++++++++++++++++++++++ references/architecture.md | 166 ++++++++++++ references/cap-development.md | 374 ++++++++++++++++++++++++++ references/cicd.md | 338 ++++++++++++++++++++++++ references/connectivity.md | 297 +++++++++++++++++++++ references/deployment.md | 480 ++++++++++++++++++++++++++++++++++ references/design-patterns.md | 331 +++++++++++++++++++++++ references/extensions.md | 267 +++++++++++++++++++ references/hana-cloud.md | 271 +++++++++++++++++++ references/mta.md | 308 ++++++++++++++++++++++ references/observability.md | 279 ++++++++++++++++++++ references/operations.md | 325 +++++++++++++++++++++++ references/partners.md | 301 +++++++++++++++++++++ references/resilience.md | 323 +++++++++++++++++++++++ references/runtimes.md | 156 +++++++++++ references/security.md | 327 +++++++++++++++++++++++ references/setup.md | 334 +++++++++++++++++++++++ references/testing.md | 400 ++++++++++++++++++++++++++++ references/tools.md | 306 ++++++++++++++++++++++ references/tutorials.md | 257 ++++++++++++++++++ references/ux-design.md | 270 +++++++++++++++++++ references/whats-new.md | 75 ++++++ 26 files changed, 7173 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 SKILL.md create mode 100644 plugin.lock.json create mode 100644 references/abap-cloud.md create mode 100644 references/architecture.md create mode 100644 references/cap-development.md create mode 100644 references/cicd.md create mode 100644 references/connectivity.md create mode 100644 references/deployment.md create mode 100644 references/design-patterns.md create mode 100644 references/extensions.md create mode 100644 references/hana-cloud.md create mode 100644 references/mta.md create mode 100644 references/observability.md create mode 100644 references/operations.md create mode 100644 references/partners.md create mode 100644 references/resilience.md create mode 100644 references/runtimes.md create mode 100644 references/security.md create mode 100644 references/setup.md create mode 100644 references/testing.md create mode 100644 references/tools.md create mode 100644 references/tutorials.md create mode 100644 references/ux-design.md create mode 100644 references/whats-new.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..f969ec6 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "sap-btp-developer-guide", + "description": "Develops business applications on BTP using CAP or ABAP Cloud. Covers Cloud Foundry, Kyma, SAP HANA Cloud integration, Fiori UIs, and multitenant SaaS applications.", + "version": "1.0.0", + "author": { + "name": "Zhongwei Li", + "email": "zhongweili@tubi.tv" + }, + "skills": [ + "./" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0575621 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# sap-btp-developer-guide + +Develops business applications on BTP using CAP or ABAP Cloud. Covers Cloud Foundry, Kyma, SAP HANA Cloud integration, Fiori UIs, and multitenant SaaS applications. diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..70f9484 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,433 @@ +--- +name: sap-btp-developer-guide +description: | + Develops business applications on SAP Business Technology Platform (BTP) using CAP (Node.js/Java) or ABAP Cloud. + + Use when: building cloud applications on SAP BTP, deploying to Cloud Foundry or Kyma runtimes, integrating with SAP HANA Cloud, implementing SAP Fiori UIs, connecting to remote SAP systems, building multitenant SaaS applications, extending SAP S/4HANA or SuccessFactors, setting up CI/CD pipelines, implementing observability, or following SAP development best practices. + + Keywords: SAP BTP, Business Technology Platform, CAP, Cloud Application Programming Model, ABAP Cloud, Cloud Foundry, Kyma, SAP HANA Cloud, SAP Fiori, SAPUI5, CI/CD, observability, multitenant, SaaS, SAP BTP ABAP environment, SAP Business Application Studio, SAP Cloud SDK, SAP Integration Suite, SAP Event Mesh, SAP Connectivity Service, SAP Destination Service, XSUAA, OAuth, OpenID Connect, OData, CDS, Core Data Services, ABAP CDS, ABAP RESTful Application Programming Model, RAP, ABAP development, SAP BTP development +license: GPL-3.0 +metadata: + version: 1.1.0 + last_verified: 2025-11-27 + source_last_updated: 2025-11-21 + review_status: "Complete - Phase 1-14 audit" +--- + +# SAP BTP Developer Guide Skill + +## Related Skills + +- **sap-btp-cloud-platform**: Use for platform fundamentals, account management, and runtime configurations +- **sap-btp-best-practices**: Use for architectural guidance, governance models, and production patterns +- **sap-cap-capire**: Use for CAP development details, service definitions, and database integration +- **sap-fiori-tools**: Use for UI development, Fiori application setup, and frontend deployment +- **sap-abap**: Use for ABAP Cloud development, RAP patterns, and ABAP Environment specifics +- **sap-btp-connectivity**: Use for implementing secure connections to on-premise systems + +Comprehensive guidance for developing, deploying, and operating business applications on SAP Business Technology Platform. + +## Table of Contents + +### Quick Navigation +- [Table of Contents](#table-of-contents) +- [When to Use This Skill](#when-to-use-this-skill) +- [Runtime and Programming Model Selection](#runtime-and-programming-model-selection) +- [Development Workflow](#development-workflow) +- [Key Services and Tools](#key-services-and-tools) +- [Security Implementation](#security-implementation) +- [Connectivity Patterns](#connectivity-patterns) +- [CI/CD Implementation](#ci-cd-implementation) +- [Observability Implementation](#observability-implementation) +- [Tutorials and Missions](#tutorials-and-missions) +- [Partner/ISV Development](#partner-isv-development) +- [Common Errors and Solutions](#common-errors-and-solutions) +- [Bundled Resources](#bundled-resources) +- [Quick Reference Links](#quick-reference-links) +- [Version Information](#version-information) + +## When to Use This Skill + +Use when: +- Building new applications on SAP BTP (Cloud Foundry or Kyma runtime) +- Developing with SAP Cloud Application Programming Model (CAP) +- Building ABAP Cloud applications in SAP BTP ABAP Environment +- Deploying SAP Fiori or SAPUI5 user interfaces +- Connecting applications to SAP S/4HANA, SuccessFactors, or on-premise systems +- Building multitenant SaaS applications +- Implementing side-by-side extensions for SAP solutions +- Setting up CI/CD pipelines for SAP BTP +- Implementing observability with SAP Cloud ALM or SAP Cloud Logging +- Using SAP HANA Cloud for data persistence + +## Runtime and Programming Model Selection + +For detailed runtime comparison: See `references/runtimes.md` + +### Decision Matrix + +| Criteria | CAP (Cloud Foundry/Kyma) | ABAP Cloud | +|----------|--------------------------|------------| +| **Languages** | Node.js, Java, TypeScript | ABAP | +| **Best For** | New cloud-native apps, extensions | Organizations with ABAP expertise | +| **Runtime** | Cloud Foundry or Kyma | SAP BTP ABAP Environment | +| **Persistence** | SAP HANA Cloud, PostgreSQL | SAP HANA Cloud (ABAP-managed) | +| **UI Framework** | SAP Fiori Elements, SAPUI5 | SAP Fiori Elements, SAPUI5 | +| **IDE** | SAP Business Application Studio, VS Code | ABAP Development Tools (Eclipse) | + +### CAP Application Development + +CAP provides three operational profiles: +- **Development**: Mock services, minimal setup, SQLite/H2 for local testing +- **Hybrid**: Local app connected to cloud services +- **Production**: Full cloud deployment with SAP HANA Cloud + +Key capabilities: +- Domain-driven design with CDS (Core Data Services) +- Built-in multitenancy support +- Automatic OData/REST service generation +- Platform-agnostic design (no vendor lock-in) + +For CAP details: See `references/cap-development.md` + +### ABAP Cloud Development + +ABAP Cloud uses four foundational technologies: +1. **Core Data Services (CDS)** - Data modeling and analytics +2. **ABAP RESTful Application Programming Model (RAP)** - Service-oriented development +3. **Restricted ABAP Language** - Cloud-safe API access +4. **Released Public APIs** - Upgrade-stable extensions + +For ABAP details: See `references/abap-cloud.md` + +## Development Workflow + +### Phase 1: Explore and Discover + +1. **Identify business problem** - Conduct stakeholder interviews +2. **Understand user needs** - Visit customers, observe workflows +3. **Define security requirements** - Threat modeling, compliance planning (GDPR, HIPAA) +4. **Establish governance** - Set up organizational structure + +### Phase 2: Design + +1. **User Experience Design** + - Follow SAP Fiori Design Guidelines + - Implement accessibility (WCAG 2.2) + - Use design thinking methodology + +2. **Technology Design** + - Apply Domain-Driven Design for complex applications (30+ use cases) + - Define module boundaries and communication patterns + - Plan microservices architecture if needed + +3. **Security in Design** + - Secure user interfaces with SAP Fiori authentication + - Implement RBAC/ABAC using OAuth/OpenID Connect + - Validate CDS models for data protection + +For design patterns: See `references/design-patterns.md` + +### Phase 3: Develop + +**CAP Development:** +```bash +# Initialize CAP project +cds init my-project +cd my-project + +# Add SAP HANA support +cds add hana + +# Add authentication +cds add xsuaa + +# Run locally +cds watch +``` + +**Key development tools:** +- SAP Business Application Studio (primary IDE) +- SAP Cloud SDK (OData/OpenAPI clients) +- MTA Build Tool (packaging) + +**Coding standards:** +- Follow SAPUI5 Guidelines and SAP Fiori Design Guidelines +- Establish naming conventions +- Implement parameterized queries (prevent SQL injection) +- Use CDS constraints for input validation + +For tools catalog: See `references/tools.md` + +### Phase 4: Deploy + +**Cloud Foundry Deployment:** +```bash +# Build MTA archive +mbt build + +# Deploy to Cloud Foundry +cf deploy mta_archives/my-project_1.0.0.mtar +``` + +**Kyma Deployment:** +```bash +# Use Helm charts or Terraform +terraform init +terraform apply +``` + +**ABAP Deployment:** +- Use Manage Software Components app (gCTS) +- Transport via Landscape Portal +- Partner options: Multitenant SaaS or Add-on Product + +For deployment details: See `references/deployment.md` + +### Phase 5: Run and Scale + +**Monitoring:** +- SAP Cloud ALM (central observability) +- SAP Cloud Logging (detailed logs, metrics, traces) +- ABAP Technical Monitoring Cockpit + +**Scaling:** +- Cloud Foundry: Automatic instance distribution across AZs +- Kyma: Kubernetes-native scaling +- ABAP: Elastic scaling with ACUs (0.5 ACU increments) + +**Cost optimization:** +- System hibernation (ABAP) - reduce to <5% operational cost +- SAP HANA Cloud Native Storage Extension +- Elastic Compute Nodes for peak workloads + +For operations: See `references/operations.md` + +## Key Services and Tools + +### Platform Services + +| Service | Purpose | +|---------|---------| +| SAP HANA Cloud | Database-as-a-Service, multi-model | +| SAP Connectivity Service | On-premise/VPC connections via Cloud Connector | +| SAP Destination Service | Routing, authentication management | +| SAP Event Mesh | Event distribution between applications | +| SAP Integration Suite | API Management, Cloud Integration | + +### Development Tools + +| Tool | Purpose | +|------|---------| +| SAP Business Application Studio | Primary cloud IDE | +| SAP Build | Low-code/no-code development | +| Cloud Foundry CLI | CF deployment and management | +| kubectl/Helm | Kyma/Kubernetes management | +| Terraform Provider for SAP BTP | Infrastructure as code | + +For architecture details: See `references/architecture.md` + +## Security Implementation + +### CAP Security Features +- Parameterized queries (SQL injection prevention) +- CSRF protection for UI applications +- Built-in authentication/authorization frameworks +- SAP Credential Store for secrets management + +### Security Guidelines +1. **Secure environment configuration** - Restrict network access +2. **Security testing** - Penetration testing before go-live +3. **Secure deployment pipelines** - Code scanning, dependency validation +4. **Secrets management** - Use SAP Credential Store + +For security details: See `references/security.md` + +## Connectivity Patterns + +### Cloud-to-On-Premise +- SAP Connectivity Service + Cloud Connector +- User propagation supported +- Protocols: HTTP, RFC, LDAP, FTP + +### Cloud-to-Cloud +- SAP Destination Service for routing +- OAuth token management +- SAP Transparent Proxy for Kubernetes + +For connectivity details: See `references/connectivity.md` + +## CI/CD Implementation + +**SAP Continuous Integration and Delivery** provides pre-configured pipelines: +- Cloud Foundry Environment jobs (SAP Fiori, CAP) +- SAP Fiori for ABAP Platform jobs +- SAP Integration Suite Artifacts jobs + +Setup steps: +1. Enable in SAP BTP cockpit +2. Assign Administrator/Developer roles +3. Configure repository credentials (GitHub, GitLab, Bitbucket, Azure Repos) +4. Add repositories and create jobs +5. Configure webhooks for automated builds + +For CI/CD details: See `references/cicd.md` + +## Observability Implementation + +### Central Layer (SAP Cloud ALM) +- Real User Monitoring +- Health Monitoring +- Integration and Exception Monitoring +- Synthetic User Monitoring + +### Local Layer (SAP Cloud Logging) +- Log Analytics (OpenSearch-based) +- Distributed tracing +- Custom dashboards and alerting + +**OpenTelemetry** is the industry standard for instrumentation. + +For observability details: See `references/observability.md` + +## Tutorials and Missions + +### CAP Learning Path +1. **Starter Mission**: Full-Stack CAP Application +2. **Extension Mission**: Side-by-Side CAP-Based Extensions +3. **Enterprise Mission**: Change Tracking, Audit Logging, Attachments +4. **Multitenant Mission**: SaaS Application Development +5. **Observability Mission**: SAP Cloud Logging Integration + +### ABAP Learning Path +1. **RAP100 Basics**: Fiori apps, OData services, business logic +2. **RAP100 Intermediate**: Actions, dynamic feature control, unit testing +3. **RAP120**: AI-assisted development with SAP Joule +4. **Analytics**: CDS views with SAP Analytics Cloud + +Sample applications: +- **Incident Management** (CAP) +- **Flight Reference Scenario** (ABAP) +- **Poetry Slam Manager** (Partner SaaS) + +For tutorial details: See `references/tutorials.md` + +## Bundled Resources + +### File Structure +``` +sap-btp-developer-guide/ +├── SKILL.md # This file - Main guidance +├── README.md # Quick reference with auto-trigger keywords +└── references/ # Detailed guides (22 files) + ├── Architecture & Setup + │ ├── architecture.md # Platform services and architecture + │ ├── runtimes.md # Runtime comparison (CF vs Kyma vs ABAP) + │ ├── setup.md # BTP landscape setup and Terraform + │ └── tools.md # Development tools catalog + ├── Development + │ ├── cap-development.md # CAP development guide + │ ├── abap-cloud.md # ABAP Cloud development guide + │ ├── design-patterns.md # Design patterns and DDD + │ ├── extensions.md # SAP solution extensions + │ ├── mta.md # Multitarget applications + │ ├── testing.md # Testing strategies + │ └── ux-design.md # UX design and Fiori + ├── Integration & Security + │ ├── connectivity.md # Connectivity patterns + │ ├── security.md # Security implementation + │ ├── hana-cloud.md # SAP HANA Cloud + │ └── resilience.md # Resilience patterns + ├── Deployment & Operations + │ ├── deployment.md # Deployment options + │ ├── cicd.md # CI/CD pipelines + │ ├── observability.md # Monitoring and logging + │ ├── operations.md # Operations and scaling + │ └── partners.md # ISV/Partner development + └── Additional Resources + ├── tutorials.md # Learning paths and missions + └── whats-new.md # Changelog and updates +``` + +### Reference Files by Category + +#### Architecture & Platform (4 files) +- `architecture.md` - Platform services overview and architecture patterns +- `runtimes.md` - Runtime comparison and selection guide +- `setup.md` - BTP landscape setup with sizing recommendations +- `tools.md` - Complete development tools catalog + +#### Development (8 files) +- `cap-development.md` - CAP development with Node.js/Java +- `abap-cloud.md` - ABAP Cloud development with RAP +- `design-patterns.md` - Domain-driven design and patterns +- `extensions.md` - Side-by-side extensions for SAP solutions +- `mta.md` - Multitarget application packaging +- `testing.md` - Testing strategies and frameworks +- `ux-design.md` - SAP Fiori UX design guidelines + +#### Integration & Security (4 files) +- `connectivity.md` - Cloud-to-on-premise connectivity +- `security.md` - Authentication, authorization, and security +- `hana-cloud.md` - SAP HANA Cloud database +- `resilience.md` - Application resilience patterns + +#### Deployment & Operations (5 files) +- `deployment.md` - Deployment to CF, Kyma, and ABAP +- `cicd.md` - CI/CD pipelines with SAP tools +- `observability.md` - Monitoring, logging, and tracing +- `operations.md` - Operations, scaling, and cost optimization +- `partners.md` - ISV/partner development guidelines + +#### Learning & Updates (2 files) +- `tutorials.md` - Hands-on missions and tutorials +- `whats-new.md` - Latest features and changelog + +## Partner/ISV Development + +### Deployment Options +1. **Multitenant SaaS** - Cloud service operated in partner's global account +2. **Add-on Product** - Installed in customer's ABAP environment + +### Requirements +- SAP PartnerEdge Build contract +- Registered ABAP namespace (mandatory) +- Landscape Portal for lifecycle management + +For partner details: See `references/partners.md` + +## Quick Reference Links + +**Official Documentation:** +- SAP BTP Help: [https://help.sap.com/docs/btp](https://help.sap.com/docs/btp) +- CAP Documentation: [https://cap.cloud.sap/docs/](https://cap.cloud.sap/docs/) +- SAP Discovery Center: [https://discovery-center.cloud.sap/](https://discovery-center.cloud.sap/) +- SAP API Business Hub: [https://api.sap.com/](https://api.sap.com/) + +**Design Resources:** +- SAP Fiori Design: [https://experience.sap.com/fiori-design-web/](https://experience.sap.com/fiori-design-web/) +- SAPUI5 SDK: [https://sapui5.hana.ondemand.com/](https://sapui5.hana.ondemand.com/) + +**Learning:** +- SAP Developers: [https://developers.sap.com/](https://developers.sap.com/) +- SAP Learning: [https://learning.sap.com/](https://learning.sap.com/) + +**Source Documentation:** +- This skill is based on: [https://github.com/SAP-docs/btp-developer-guide](https://github.com/SAP-docs/btp-developer-guide) + +## Common Errors and Solutions + +| Error | Cause | Solution | +|-------|-------|----------| +| Third-party cookie issues | Browser deprecation | See SAP Note 3409306 | +| XSUAA binding failures | Missing service instance | Run `cf create-service xsuaa application` | +| HANA deployment errors | Wrong target container | Check `requires` in mta.yaml | +| ATC Priority 1 findings | Non-cloud-compliant code | Use ABAP_CLOUD_DEVELOPMENT_DEFAULT variant | + +## Version Information + +- **Skill Version**: 1.1.0 +- **Last Verified**: 2025-11-27 +- **Source Last Updated**: 2025-11-21 +- **Based On**: SAP BTP Developer Guide ([https://github.com/SAP-docs/btp-developer-guide](https://github.com/SAP-docs/btp-developer-guide)) +- **Next Review**: 2026-02-21 diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..ea6d736 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,133 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:secondsky/sap-skills:skills/sap-btp-developer-guide", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "2e253779c8fcc317fb7b3f4c39efc6294f8dd31f", + "treeHash": "c73f8003465a823e20a38a226d76ab911561490e9c4a67c540002b4c0eb7cd84", + "generatedAt": "2025-11-28T10:28:12.400693Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "sap-btp-developer-guide", + "description": "Develops business applications on BTP using CAP or ABAP Cloud. Covers Cloud Foundry, Kyma, SAP HANA Cloud integration, Fiori UIs, and multitenant SaaS applications.", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6430d2ac69728f5980d96971703776b27d0edaa1137db28b3d1f46cdaadcfa4d" + }, + { + "path": "SKILL.md", + "sha256": "72e9d7d240ab08422a8d0e7ab2f3946070bb3b18c5ecfb2b55c136d2f2a0e1fb" + }, + { + "path": "references/architecture.md", + "sha256": "747e5067951e67afac8d89320063eaf9e8885b2cc88057a386ce830e326d52f5" + }, + { + "path": "references/operations.md", + "sha256": "61622ed36498369faad47c546f6787ca0c1c9dafef8836f81860200475434f55" + }, + { + "path": "references/extensions.md", + "sha256": "6585d41776672cce0e9ae2e502cb4c4b696af795f726fcd38164d628fd2dff6a" + }, + { + "path": "references/abap-cloud.md", + "sha256": "89affc7a58ff396777c62d95abeaaa1bdb22079ef926b8e63527ba541411291e" + }, + { + "path": "references/setup.md", + "sha256": "b866f00bf08fce652d366907e3397c708d33f2fec1b870e95f3a0ec1504cd563" + }, + { + "path": "references/resilience.md", + "sha256": "304f9371cc386ac7fbc10cb6fc94eb254ceb451c63ff1b4661dad4377bf8ea43" + }, + { + "path": "references/testing.md", + "sha256": "541d07f678ca8ed5c24d7e4257ea68015650057bdc4dc1b83acbf0432e50455a" + }, + { + "path": "references/cicd.md", + "sha256": "e422a835e6c4083ebb011a0688a5a546bd9ecae1db90c7510172f18fbc2ad33f" + }, + { + "path": "references/tutorials.md", + "sha256": "3b63a9820b45faf269f0cc45beaa2e14040a9572d2b53c4c41f42fcff6bb8697" + }, + { + "path": "references/whats-new.md", + "sha256": "5c2608403d4b8d0957271a3c172afb38c8af26a447aebf9e92f1330b11f30abf" + }, + { + "path": "references/cap-development.md", + "sha256": "c700895f8d04aec46929028a864e4b00bf72b89a7ce49c7dfaaee7c9cd017b76" + }, + { + "path": "references/mta.md", + "sha256": "ec39fb1f305c194cd9541adc1696ba2c55dec4c3cea8123caf002b875921346d" + }, + { + "path": "references/deployment.md", + "sha256": "a7460574356ce1131554e173294f11784481c0c5942b7c8aefa3ddd3793a2d81" + }, + { + "path": "references/design-patterns.md", + "sha256": "0440b13c92ff2388847833c4ff65a608b71f411bfb324a6bbe382041afba4804" + }, + { + "path": "references/connectivity.md", + "sha256": "61105d4f2feb09697829d942cd632a8fd8f477c71dc27b6ea65bbf0799d914a3" + }, + { + "path": "references/partners.md", + "sha256": "84ce7cc4f5f9198918dbbe2dbf9992cfe46edc9be3117d591321f181bf77113a" + }, + { + "path": "references/ux-design.md", + "sha256": "8280eeefb444d9d763dd5ed9f564aff3aa28e73445de474c88a19b27ab41d512" + }, + { + "path": "references/hana-cloud.md", + "sha256": "f475b4a4ba87b02384f156f3e475cc15cda99111f529e3280ba723a6b46fc5fb" + }, + { + "path": "references/observability.md", + "sha256": "3aca835352e82dfbe38c826b1a5050e2fa45e1a7cb1e685afc2ecf6dd525a0c4" + }, + { + "path": "references/runtimes.md", + "sha256": "6a8a1ef0a7aece5d3c2f27f66f8e31f2223e5d78af7494d65610a5264e8de600" + }, + { + "path": "references/security.md", + "sha256": "e92f7e65b4e042904cdd766f1c1fbead6fa01b0ad85f3a159a08d914fa9c28fb" + }, + { + "path": "references/tools.md", + "sha256": "9837604beb8f341cbf2f0223848c5f1fe0344fce9b80935dd3ffbcad1cff91ba" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "dd22353fd81d84689ee7b7bcbb91cffa87dadb9ad866f70efac75f48071b08e6" + } + ], + "dirSha256": "c73f8003465a823e20a38a226d76ab911561490e9c4a67c540002b4c0eb7cd84" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/references/abap-cloud.md b/references/abap-cloud.md new file mode 100644 index 0000000..e179981 --- /dev/null +++ b/references/abap-cloud.md @@ -0,0 +1,407 @@ +# ABAP Cloud Development Reference + +## Overview + +ABAP Cloud is SAP's cloud-ready development model for building extensible, maintainable applications in the SAP BTP ABAP Environment. + +## Foundational Technologies + +| Technology | Purpose | +|------------|---------| +| Core Data Services (CDS) | Data modeling, integrated analytics | +| ABAP RESTful Application Programming Model (RAP) | Service-oriented application development | +| Restricted ABAP Language | Cloud-safe development through controlled API access | +| Released Public APIs | Upgrade-stable extensions | + +## Development Environment + +**Primary IDE**: ABAP Development Tools for Eclipse (ADT) + +**Additional Tools:** +- ABAP Test Cockpit (ATC) - Static analysis +- ABAP Unit - Dynamic testing +- SAP Fiori Launchpad - UI deployment + +## Application Development Process + +### 6-Step Development Workflow + +| Step | Activity | Details | +|------|----------|---------| +| 1 | **Model the Domain** | Define domain-specific data models aligned with RAP architecture | +| 2 | **Implement Business Behavior** | Add validations, determinations, actions, consistency management | +| 3 | **Expose Services** | Define and bind services via OData | +| 4 | **Secure Access** | Configure authorization, assign proper scopes and roles | +| 5 | **Build the UI** | Develop SAP Fiori applications consuming services | +| 6 | **Ensure Quality** | Add automated tests and static checks | + +### Development Approaches + +**Develop from Scratch:** +- Build new applications and services using RAP blueprint +- Domain-specific data models with extensibility built-in + +**Extend Existing Services:** +- Extend SAP or custom services in upgrade-safe way +- Opt-in extensibility: original data models must explicitly enable each option + +### S/4HANA Extension Options + +| Type | Description | Use Case | +|------|-------------|----------| +| **On-Stack** | Extensions run within S/4HANA Cloud, share database and lifecycle | Tight integration, key-user extensibility (low-code), developer extensibility (pro-code) | +| **Side-by-Side** | Extensions run on SAP BTP with separate runtime and lifecycle | Loosely coupled solutions, partner offerings, hub scenarios | + +### Test Strategy + +**Automated Testing** is essential for reliability, stability, and quality: + +- **Unit Tests**: ABAP Unit for functional correctness +- **Integration Tests**: Cross-component validation +- **Static Analysis**: ABAP Test Cockpit (ATC) + +### Development Recommendations + +1. Connect ABAP Cloud systems to Eclipse with ABAP Development Tools +2. Build OData services using RAP optimized for SAP HANA Cloud +3. Perform static code analysis with ATC including Code Vulnerability Analyzer +4. Use central ATC on SAP BTP for custom code governance +5. Leverage the Analyze Custom Code application for code inspection + +## Model-Driven Architecture + +### Three-Tier Structure +1. **Data Access Layer** - Database tables, CDS views +2. **Domain Model Layer** - Business logic, validations +3. **Service Exposure Layer** - OData services, Web APIs + +### Benefits +- Faster delivery via standardized stacks +- Interoperability through consistent rules +- Multipurpose CDS models (transactional + analytical) + +## CDS Data Modeling + +### Basic Entity Definition +```abap +@EndUserText.label: 'Travel' +@AccessControl.authorizationCheck: #NOT_REQUIRED +define root view entity ZI_Travel + as select from ztravel +{ + key travel_uuid as TravelUUID, + travel_id as TravelID, + agency_id as AgencyID, + customer_id as CustomerID, + begin_date as BeginDate, + end_date as EndDate, + booking_fee as BookingFee, + total_price as TotalPrice, + currency_code as CurrencyCode, + description as Description, + overall_status as OverallStatus, + @Semantics.user.createdBy: true + created_by as CreatedBy, + @Semantics.systemDateTime.createdAt: true + created_at as CreatedAt, + @Semantics.user.lastChangedBy: true + last_changed_by as LastChangedBy, + @Semantics.systemDateTime.lastChangedAt: true + last_changed_at as LastChangedAt +} +``` + +### Projection View for UI +```abap +@EndUserText.label: 'Travel Projection' +@AccessControl.authorizationCheck: #NOT_REQUIRED +@Metadata.allowExtensions: true +define root view entity ZC_Travel + provider contract transactional_query + as projection on ZI_Travel +{ + key TravelUUID, + TravelID, + AgencyID, + CustomerID, + BeginDate, + EndDate, + BookingFee, + TotalPrice, + CurrencyCode, + Description, + OverallStatus, + CreatedBy, + CreatedAt, + LastChangedBy, + LastChangedAt +} +``` + +## RAP Business Object Definition + +### Behavior Definition +```abap +managed implementation in class zbp_i_travel unique; +strict ( 2 ); + +define behavior for ZI_Travel alias Travel +persistent table ztravel +lock master +authorization master ( instance ) +etag master LastChangedAt +{ + // Standard operations + create; + update; + delete; + + // Field controls + field ( readonly ) TravelUUID, TravelID, CreatedBy, CreatedAt, LastChangedBy, LastChangedAt; + field ( mandatory ) AgencyID, CustomerID; + + // Determinations + determination setTravelID on modify { create; } + determination calculateTotalPrice on modify { field BookingFee; } + + // Validations + validation validateCustomer on save { field CustomerID; } + validation validateDates on save { field BeginDate, EndDate; } + + // Actions + action acceptTravel result [1] $self; + action rejectTravel result [1] $self; + + // Factory action + factory action copyTravel [1]; + + // Draft handling + draft action Edit; + draft action Activate optimized; + draft action Discard; + draft action Resume; + draft determine action Prepare; +} +``` + +### Behavior Implementation +```abap +CLASS zbp_i_travel DEFINITION PUBLIC ABSTRACT FINAL + FOR BEHAVIOR OF zi_travel. +ENDCLASS. + +CLASS zbp_i_travel IMPLEMENTATION. + + METHOD setTravelID. + " Get max Travel ID + SELECT MAX( travel_id ) FROM ztravel INTO @DATA(lv_max_id). + + " Set Travel ID for new entities + MODIFY ENTITIES OF zi_travel IN LOCAL MODE + ENTITY Travel + UPDATE FIELDS ( TravelID ) + WITH VALUE #( FOR key IN keys + ( %tky = key-%tky + TravelID = lv_max_id + 1 ) ). + ENDMETHOD. + + METHOD validateDates. + READ ENTITIES OF zi_travel IN LOCAL MODE + ENTITY Travel + FIELDS ( BeginDate EndDate ) + WITH CORRESPONDING #( keys ) + RESULT DATA(lt_travels). + + LOOP AT lt_travels INTO DATA(ls_travel). + IF ls_travel-BeginDate > ls_travel-EndDate. + APPEND VALUE #( %tky = ls_travel-%tky ) TO failed-travel. + APPEND VALUE #( %tky = ls_travel-%tky + %msg = new_message_with_text( + severity = if_abap_behv_message=>severity-error + text = 'End date must be after begin date' ) + ) TO reported-travel. + ENDIF. + ENDLOOP. + ENDMETHOD. + +ENDCLASS. +``` + +## Service Definition and Binding + +### Service Definition +```abap +@EndUserText.label: 'Travel Service Definition' +define service ZUI_TRAVEL_O4 { + expose ZC_Travel as Travel; +} +``` + +### Service Binding +Create via ADT: OData V4 - UI binding type + +## Extensibility Options + +### Developer Extensibility +- Custom fields and nodes +- Custom business logic +- ABAP Development Tools required + +### Key User Extensibility (Multitenant SaaS) +- UI adaptations +- Custom fields +- Business Add-Ins (BAdIs) +- No coding required + +## Reuse Services + +Pre-built building blocks available: +- Application Jobs +- Application Logging +- Forms (Adobe Document Services) +- Emails +- Change Documents +- Workflow (SAP Build Process Automation) +- Number Ranges + +## Transport Mechanisms + +### gCTS (Recommended) +- Modern transport for BTP systems within same global account +- Managed via "Manage Software Components" app +- Automatic Git repository management + +### abapGit +- Open-source Git client +- Use cases: + - Migrate on-premise code to cloud + - System decommissioning (export/import) + - Cross-account code transfers +- **Not recommended** for standard production transports + +## Quality Assurance + +### ABAP Test Cockpit (ATC) + +**Default Variant**: `ABAP_CLOUD_DEVELOPMENT_DEFAULT` + +**Check Categories:** +- Approved enhancement technologies +- API usage governance +- Critical ABAP statement analysis +- Code Vulnerability Analyzer (optional) + +**Blocking Mode:** +Configure to prevent Priority 1/2 findings from transport + +### ABAP Unit Testing +```abap +CLASS ltcl_travel DEFINITION FINAL FOR TESTING + DURATION SHORT + RISK LEVEL HARMLESS. + + PRIVATE SECTION. + DATA: mo_cut TYPE REF TO zcl_travel_handler. + + METHODS setup. + METHODS test_date_validation FOR TESTING. +ENDCLASS. + +CLASS ltcl_travel IMPLEMENTATION. + + METHOD setup. + mo_cut = NEW #( ). + ENDMETHOD. + + METHOD test_date_validation. + " Given + DATA(lv_begin) = cl_abap_context_info=>get_system_date( ). + DATA(lv_end) = lv_begin + 7. + + " When + DATA(lv_valid) = mo_cut->validate_dates( + iv_begin = lv_begin + iv_end = lv_end + ). + + " Then + cl_abap_unit_assert=>assert_true( lv_valid ). + ENDMETHOD. + +ENDCLASS. +``` + +## Elastic Scaling + +### ABAP Compute Units (ACUs) +- Manual scaling via BTP Cockpit +- Automatic elastic scaling (0.5 ACU increments) +- Metrics: CPU, memory, work process counts + +### HANA Compute Units (HCUs) +- Manual adjustment with near-zero downtime +- Native Storage Extension for cost optimization + +## System Hibernation + +**Benefits:** +- Reduces costs to <5% of operational expenses +- Preserves HANA Cloud instance +- Automatic restart during scheduled maintenance + +**Management:** +- Via Landscape Portal +- Scheduling available (except trial accounts) + +## SAP Joule Integration + +**AI Capabilities:** +1. Predictive code completion +2. Joule chat (natural language) +3. Code explanation +4. ABAP Unit generation +5. CDS test generation + +**ABAP AI SDK:** +- Standardized access to language models on SAP AI Core +- Intelligent Scenario Lifecycle Management + +## Partner Deployment Models + +### Multitenant SaaS +- Cloud service in partner's global account +- Customers subscribe +- Partner manages operations +- Key user extensibility for customers + +### Add-on Product +- Installed in customer's ABAP environment +- Customer manages lifecycle +- Developer extensibility available +- Requires SAP PartnerEdge Build contract + +### Requirements +- Registered ABAP namespace (mandatory) +- Software Components for transport +- Landscape Portal for lifecycle management + +## Upgrade Management + +### Downtime-Optimized Upgrades +1. **Preparation**: New release in shadow layer (system available) +2. **Takeover**: 10-40 minutes downtime +3. **Postprocessing**: Background cleanup (system available) + +### Pre-Upgrade Option +- Test on non-production 4 weeks before release +- Validate custom applications +- Report issues through SAP support + +## Source Documentation + +- ABAP Environment: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-abap-environment-with-abap-cloud-174b229.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-abap-environment-with-abap-cloud-174b229.md) +- ABAP Cloud Development: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/developing-with-abap-cloud-in-the-sap-btp-abap-environment-9aaaf65.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/developing-with-abap-cloud-in-the-sap-btp-abap-environment-9aaaf65.md) +- Elastic Scaling: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/benefit-from-the-elastic-scaling-of-abap-application-servers-c1d35c5.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/benefit-from-the-elastic-scaling-of-abap-application-servers-c1d35c5.md) +- System Hibernation: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/use-system-hibernation-6a8d7ee.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/use-system-hibernation-6a8d7ee.md) +- ATC Governance: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/keep-clean-core-governance-with-abap-test-cockpit-698ddfa.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/keep-clean-core-governance-with-abap-test-cockpit-698ddfa.md) +- Joule: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/use-joule-for-developers-generative-ai-in-abap-cloud-63c8ac1.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/use-joule-for-developers-generative-ai-in-abap-cloud-63c8ac1.md) diff --git a/references/architecture.md b/references/architecture.md new file mode 100644 index 0000000..51d63b7 --- /dev/null +++ b/references/architecture.md @@ -0,0 +1,166 @@ +# SAP BTP Architecture Reference + +## Platform Overview + +SAP BTP provides a three-tier architecture: +- **Presentation Layer**: SAP Fiori/SAPUI5 frontends +- **Logic Layer**: CAP (Node.js/Java) or ABAP Cloud +- **Persistence Layer**: SAP HANA Cloud + +**Data Protocols:** +- OData (transactional data) +- InA (analytical data) + +## Core Services Catalog + +### Persistence & Data + +| Service | Purpose | Details | +|---------|---------|---------| +| SAP HANA Cloud | Database-as-a-Service | Relational, document, geospatial, vector data | +| HANA Data Lake Files | Object storage | Large-scale data storage | +| SAP Datasphere | Cross-application analytics | Data federation and warehousing | + +**HANA Cloud Optimization Features:** + +| Feature | Description | Free/Trial | Paid | +|---------|-------------|------------|------| +| **Native Storage Extension (NSE)** | Store infrequently accessed data on disk | No | Yes | +| **Elastic Compute Nodes (ECN)** | On-demand scaling for peak workloads | No | Yes | +| **Table Partitioning** | Enhanced query performance | Limited | Yes | +| **Native Multi-Tenancy** | Up to 1,000 isolated tenants per instance | No | Yes | +| **Free Tier** | 16GB memory at no cost | Yes (16GB) | N/A | + +> **Note**: Feature availability varies by plan. See [SAP HANA Cloud Capacity Units](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-administration-guide/capacity-units) for detailed tier comparison. + +### Integration Services + +| Service | Purpose | Supported Scenarios | +|---------|---------|---------------------| +| SAP Event Mesh | Event distribution | Cross-application eventing | +| SAP Integration Suite | API Management, Cloud Integration | B2B, A2A, API publishing | +| SAP Master Data Integration | Central data hub | SAP One Domain Model | +| Cloud Integration Automation | Guided workflows | Automated integration setup | + +### Identity & Security + +| Service | CAP | ABAP | +|---------|-----|------| +| SAP Authentication and Trust Management | Yes | Yes | +| Identity Authentication | Yes (SSO, on-prem) | Yes (SSO, on-prem) | +| SAP Credential Store | Yes (secrets via REST) | Communication Management | +| SAP Audit Log Service | Yes | Security audit logging | +| Identity Provisioning | Yes | Yes (business user provisioning) | + +### Workflow & Automation + +| Service | Purpose | +|---------|---------| +| SAP Task Center | Unified inbox across applications | +| SAP Build Process Automation | Workflow, RPA, decision management | +| SAP Job Scheduling Service | REST APIs, recurring schedules (CAP) | +| Application Jobs | Integrated scheduling (ABAP) | + +### Observability + +| Service | Purpose | +|---------|---------| +| SAP Cloud ALM | Central monitoring (RUM, health, integration) | +| SAP Cloud Logging | Logs, metrics, traces (OpenSearch-based) | +| SAP Alert Notification | Event subscriptions, multi-channel delivery | +| Technical Monitoring Cockpit | ABAP on-stack analysis | + +### Extensibility Services + +| Service | Purpose | +|---------|---------| +| SAP S/4HANA Cloud Extensibility | Side-by-side extensions | +| SAP SuccessFactors Extensibility | HR solution extensions | +| SAP Build Work Zone | Business sites, central entry point | + +## Client Libraries + +### CAP (Non-ABAP) +- **SAP Cloud SDK**: OData/OpenAPI clients, Destination, Connectivity services +- **Languages**: Java (Spring Boot), JavaScript, TypeScript (Node.js) +- **Guaranteed Node.js/Java version compatibility** + +### ABAP +- **Service Consumption Model**: Generates local APIs for OData, SOAP, RFC +- **Communication Management**: System integration with credentials +- **Native RAP event support** + +## User Interface Options + +### Web Development +| Approach | Description | Use When | +|----------|-------------|----------| +| SAP Fiori Elements | Predefined templates (List Report, Object Page) | Standard business apps | +| Flexible Programming Model | Fiori Elements + custom extensions | Selective customization | +| Freestyle SAPUI5 | Full UI control | Highly custom interfaces | + +### Mobile Development +| SDK | Platform | +|-----|----------| +| SAP Mobile Development Kit | Cross-platform | +| SAP BTP SDK for Android | Android native | +| SAP BTP SDK for iOS | iOS native | + +Features: Offline sync, push notifications, mobile security + +## Central Access Points + +| Application Type | Entry Point | +|-----------------|-------------| +| CAP Applications | SAP Build Work Zone, HTML5 Repository | +| ABAP Applications | SAP Fiori Launchpad for BTP ABAP Environment | + +## Analytics Capabilities + +### CAP +- SAP Analytics Cloud (embedded dashboards) +- SAP Datasphere (cross-application analytics) + +### ABAP +- SAP Analytics Cloud on InA-enabled CDS models +- Dragonfly-based multidimensional reporting +- SAP Datasphere via ABAP SQL Service + +## System Landscape Management + +### Unified Customer Landscape +- Auto-discovery of associated systems +- Manual system registration +- Support for S/4HANA, Ariba, SuccessFactors, third-party + +### ABAP-Specific +- Landscape Portal for system hibernation +- Pre-upgrade nomination for quarterly releases + +## Low-Code/No-Code Options + +**SAP Build Suite:** +- SAP Build Apps (enterprise applications) +- SAP Build Process Automation (workflow, RPA) +- SAP Build Work Zone (business sites) +- Prebuilt connectors for SAP and third-party + +## Infrastructure Automation + +| Tool | Purpose | +|------|---------| +| Terraform Provider for SAP BTP | Resource provisioning automation | +| SAP Automation Pilot | Operational task automation, database lifecycle | + +## Key Design Principles + +1. **API-First**: Follow SAP Business Accelerator Hub guidelines +2. **Compliance**: Accessibility, theming for all UI components +3. **Observability**: Central unified operations experience +4. **Consistency**: Unified solution experience across customer base +5. **Enterprise Standards**: Prefer SAP BTP services over custom solutions + +## Source Documentation + +- Understanding Available Technology: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/understanding-available-technology-c1f21a4.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/understanding-available-technology-c1f21a4.md) +- Tools Available: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tools-available-for-sap-btp-multi-cloud-foundation-7f95cfa.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tools-available-for-sap-btp-multi-cloud-foundation-7f95cfa.md) diff --git a/references/cap-development.md b/references/cap-development.md new file mode 100644 index 0000000..8f4b04f --- /dev/null +++ b/references/cap-development.md @@ -0,0 +1,374 @@ +# CAP Development Reference + +## Overview + +SAP Cloud Application Programming Model (CAP) is SAP's recommended framework for building enterprise-grade applications on SAP BTP using Node.js or Java. + +## Operational Profiles + +CAP provides three operational profiles for different development stages: + +### Development Profile + +**Database**: SQLite (Node.js) / H2 (Java) + +**Features:** +- Rapid prototyping with minimal setup +- Mocked variants of SAP BTP services (authentication, database, messaging, app gateway) +- No BTP subscription required +- Cost-effective testing + +**Usage:** +```bash +cds watch # Automatically uses development profile +``` + +### Hybrid Profile + +**Database**: Cloud services (e.g., SAP HANA Cloud) + +**Features:** +- Run application locally +- Bind to real cloud services for integration testing +- Use `cds bind` or local configuration files +- Test with production-like data + +**Usage:** +```bash +cds bind --to hana:my-hana-instance +cds watch --profile hybrid +``` + +### Production Profile + +**Database**: SAP HANA Cloud + +**Features:** +- Deployed to SAP BTP (Cloud Foundry or Kyma) +- Platform-managed service bindings +- Production configuration for logging and security +- Database migrations via `cds deploy` + +**Usage:** +```bash +cds build --production +cf deploy mta_archives/my-app.mtar +``` + +### Profile Summary + +| Profile | Database | Use Case | +|---------|----------|----------| +| Development | SQLite/H2 | Local prototyping, mock services | +| Hybrid | Cloud services | Local app with cloud DB/services | +| Production | SAP HANA Cloud | Full cloud deployment | + +## Supported Languages and Runtimes + +| Language | Framework | Runtime Options | +|----------|-----------|-----------------| +| Node.js | Express.js | Cloud Foundry, Kyma | +| Java | Spring Boot | Cloud Foundry, Kyma | +| TypeScript | Node.js | Cloud Foundry, Kyma | + +## Development Tools + +| Tool | Purpose | +|------|---------| +| SAP Business Application Studio | Primary cloud IDE | +| Visual Studio Code | Local development with CDS extension | +| IntelliJ IDEA | Java CAP development | +| CDS CLI | Command-line development | + +## Core CDS Commands + +```bash +# Initialize new project +cds init my-project + +# Add features +cds add hana # SAP HANA Cloud support +cds add xsuaa # Authentication +cds add mta # MTA descriptor +cds add helm # Helm charts for Kyma +cds add multitenancy # Multitenant support +cds add approuter # Application router + +# Development +cds watch # Run with live reload +cds build # Build for deployment +cds deploy # Deploy to HANA + +# Service inspection +cds compile # Compile CDS models +cds serve # Start services +``` + +## Domain Modeling with CDS + +### Entity Definition +```cds +namespace my.bookshop; + +entity Books { + key ID : UUID; + title : String(111); + author : Association to Authors; + stock : Integer; +} + +entity Authors { + key ID : UUID; + name : String(111); + books : Association to many Books on books.author = $self; +} +``` + +### Service Definition +```cds +using my.bookshop from '../db/schema'; + +service CatalogService { + @readonly entity Books as projection on bookshop.Books; + entity Authors as projection on bookshop.Authors; + + action submitOrder(book: Books:ID, quantity: Integer); +} +``` + +## CAP Design Principles + +### Domain-Driven Design +- Focus on core domain logic +- Align code structure with business concepts +- Collaboration between technical and domain experts + +### Agnostic Design +CAP abstracts: +- Deployment approaches +- Authentication strategies +- Protocols (REST, OData, GraphQL) +- Asynchronous channels +- Database technologies + +### Out-of-the-Box Integration +- SAP HANA Cloud for persistence +- Authorization management services +- Connectivity tools for external systems + +## Platform Integration + +### Database Support +| Database | Use Case | +|----------|----------| +| SQLite | Development (Node.js) | +| H2 | Development (Java) | +| PostgreSQL | Production alternative | +| SAP HANA Cloud | Production (recommended) | + +### Service Bindings +```yaml +# mta.yaml service binding example +modules: + - name: my-srv + type: nodejs + requires: + - name: my-hana + - name: my-xsuaa + - name: my-destination + +resources: + - name: my-hana + type: com.sap.xs.hdi-container + - name: my-xsuaa + type: org.cloudfoundry.managed-service + parameters: + service: xsuaa + service-plan: application +``` + +## Microservices Architecture + +CAP supports microservice development with: +- Separate lifecycles per service +- Independent runtimes +- Event-based communication + +**Considerations:** +- Microservices introduce complexity +- Potential performance trade-offs +- Start monolithic, extract when needed + +## API Consumption + +### Supported Protocols +- OData V2/V4 +- REST +- OpenAPI + +### SAP Cloud SDK Integration + +**Generate typed client** (recommended approach): +```bash +# Generate OData client from service specification +npx @sap-cloud-sdk/generator --input ./API_BUSINESS_PARTNER.edmx --outputDir ./generated +``` + +**Use generated client**: +```javascript +// Import from generated client (path depends on generator output) +const { businessPartnerApi } = require('./generated/business-partner-service'); + +// Fetch business partners from S/4HANA +const businessPartners = await businessPartnerApi + .requestBuilder() + .getAll() + .execute({ destinationName: 'S4HANA' }); +``` + +> **Note**: The `@sap/cloud-sdk-vdm-*` packages are deprecated. Use `@sap-cloud-sdk/generator` to generate typed clients from OData service specifications. See [SAP Cloud SDK documentation](https://sap.github.io/cloud-sdk/docs/js/features/odata/generate-client) for details. + +## Multitenancy + +### Enable Multitenancy +```bash +cds add multitenancy +``` + +### Key Features +- Tenant isolation +- Per-tenant database schemas +- Subscription lifecycle hooks +- Resource sharing across tenants + +### SaaS Entry Points + +| Approach | Description | Consumer Requirements | +|----------|-------------|----------------------| +| Central | SAP Build Work Zone managed | Own Work Zone instance | +| Local | Standalone app router | None | + +## Extensibility + +### In-App Extensions +```cds +// Extend existing service +extend service CatalogService with { + entity CustomEntity { + key ID : UUID; + customField : String; + } +} +``` + +### Custom Handlers +```javascript +// srv/cat-service.js +module.exports = (srv) => { + srv.before('CREATE', 'Books', async (req) => { + // Validation logic + if (!req.data.title) { + req.error(400, 'Title is required'); + } + }); + + srv.on('submitOrder', async (req) => { + // Custom action implementation + const { book, quantity } = req.data; + // Process order... + }); +}; +``` + +## Security Implementation + +### Authentication +```cds +// Require authentication +service CatalogService @(requires: 'authenticated-user') { + entity Books as projection on bookshop.Books; +} +``` + +### Authorization +```cds +// Role-based access +service AdminService @(requires: 'admin') { + entity Books as projection on bookshop.Books; + + @(restrict: [{ grant: 'READ', to: 'viewer' }]) + entity Reports { ... } +} +``` + +### Built-in Security Features +- Parameterized queries (SQL injection prevention) +- CSRF protection for UI applications +- CDS constraints for input validation + +## Testing + +### Unit Testing with Jest +```javascript +const cds = require('@sap/cds'); + +describe('CatalogService', () => { + let srv; + + beforeAll(async () => { + srv = await cds.connect.to('CatalogService'); + }); + + it('should return books', async () => { + const books = await srv.read('Books'); + expect(books).toBeDefined(); + }); +}); +``` + +### Integration Testing +```bash +# Run tests +npm test + +# With coverage +npm test -- --coverage +``` + +## Deployment Commands + +### Cloud Foundry +```bash +# Build MTA +mbt build + +# Deploy +cf deploy mta_archives/my-project_1.0.0.mtar + +# Or with cf push for simple apps +cf push +``` + +### Kyma +```bash +# Add Helm support +cds add helm + +# Deploy with Helm +helm upgrade --install my-app ./chart +``` + +## Common Issues and Solutions + +| Issue | Cause | Solution | +|-------|-------|----------| +| `HANA deployment fails` | Wrong HDI container | Verify `requires` in mta.yaml | +| `Authentication errors` | XSUAA not bound | Run `cf bind-service` | +| `Database connection refused` | Wrong profile | Set `NODE_ENV=production` | +| `Model compilation errors` | CDS syntax | Run `cds compile --to json` for details | + +## Source Documentation + +- CAP Documentation: [https://cap.cloud.sap/docs/](https://cap.cloud.sap/docs/) +- SAP BTP CF/Kyma with CAP: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-cloud-foundry-and-sap-btp-kyma-runtimes-with-cap-0f9cfe9.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-cloud-foundry-and-sap-btp-kyma-runtimes-with-cap-0f9cfe9.md) +- Development Guide: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/develop-7e30686.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/develop-7e30686.md) diff --git a/references/cicd.md b/references/cicd.md new file mode 100644 index 0000000..1f9006f --- /dev/null +++ b/references/cicd.md @@ -0,0 +1,338 @@ +# SAP BTP CI/CD Reference + +## Overview + +Continuous Integration (CI) and Continuous Delivery (CD) are complementary DevOps practices that automate application development, testing, and deployment on SAP BTP. + +## Core Concepts + +### Continuous Integration (CI) +- Frequent code integration into central repository +- Automated builds and tests on each commit +- Early error detection +- Prevents integration problems from accumulating + +### Continuous Delivery (CD) +- Extends CI with deployment automation +- Successfully tested changes ready for production +- Code built, tested, and packaged in deployable format +- Deploy at management's discretion + +## SAP Continuous Integration and Delivery + +**Service Type**: BTP-native service with pre-configured pipelines + +### Advantages + +| Feature | Benefit | +|---------|---------| +| Simplicity | Out-of-the-box pipelines, minimal configuration | +| Flexibility | Customizable pipelines, additional commands | +| Infrastructure | Built-in management, no server maintenance | +| SAP-Specific | Optimized for SAP technologies | + +### Supported Pipeline Types + +| Pipeline | Use Case | +|----------|----------| +| Cloud Foundry Environment | SAP Fiori, CAP applications | +| SAP Fiori for ABAP Platform | Fiori apps on ABAP | +| SAP Integration Suite Artifacts | Integration content | + +## Setup Process + +### Step 1: Enable Service + +1. Open SAP BTP Cockpit +2. Navigate to subaccount +3. Enable "Continuous Integration & Delivery" +4. Subscribe to the service + +### Step 2: Assign Roles + +| Role | Permissions | +|------|-------------| +| Administrator | Full access, job management | +| Developer | Create/run jobs, view results | + +### Step 3: Configure Repository Credentials + +**Supported Repositories:** +- GitHub +- GitLab +- Bitbucket +- Azure Repos + +```yaml +# Example credential configuration +credentials: + - name: github-credentials + type: basic + username: ${GITHUB_USER} + password: ${GITHUB_TOKEN} +``` + +### Step 4: Create CI/CD Job + +```yaml +# .pipeline/config.yml for CAP application +general: + projectName: my-cap-app + buildTool: mta + +stages: + Build: + mtaBuildParameters: + platform: cf + + Additional Unit Tests: + npmExecuteScripts: true + npmScripts: ['test'] + + Release: + cloudFoundryDeploy: true + cfApiEndpoint: [https://api.cf.eu10.hana.ondemand.com](https://api.cf.eu10.hana.ondemand.com) + cfOrg: my-org + cfSpace: my-space + mtarFilePath: mta_archives/my-cap-app.mtar +``` + +### Step 5: Configure Webhooks + +Automate builds on push: +1. Copy webhook URL from CI/CD service +2. Add webhook in repository settings +3. Select events (push, pull request) + +## Pipeline Configuration + +### CAP Node.js Pipeline + +```yaml +# .pipeline/config.yml +general: + buildTool: mta + +stages: + Build: + mtaBuildParameters: + platform: cf + + Additional Unit Tests: + npmExecuteScripts: true + npmScripts: + - test + + Acceptance: + cfDeploy: true + cloudFoundryDeploy: true + cfApiEndpoint: [https://api.cf.eu10.hana.ondemand.com](https://api.cf.eu10.hana.ondemand.com) + cfOrg: my-org + cfSpace: dev + + Release: + cfDeploy: true + cloudFoundryDeploy: true + cfApiEndpoint: [https://api.cf.eu10.hana.ondemand.com](https://api.cf.eu10.hana.ondemand.com) + cfOrg: my-org + cfSpace: prod +``` + +### CAP Java Pipeline + +```yaml +general: + buildTool: mta + +stages: + Build: + mtaBuildParameters: + platform: cf + mavenExecuteStaticCodeChecks: true + + Additional Unit Tests: + mavenExecute: true + goals: ['test'] +``` + +### SAP Fiori Pipeline + +```yaml +general: + buildTool: npm + +stages: + Build: + npmExecuteScripts: true + npmScripts: ['build'] + + Additional Unit Tests: + npmExecuteScripts: true + npmScripts: ['test'] + karmaExecuteTests: true +``` + +## ABAP CI/CD + +### gCTS Integration + +```yaml +# Pipeline for ABAP Cloud +stages: + Import: + abapEnvironmentPullGitRepo: true + repositoryName: my-software-component + + Test: + abapEnvironmentRunATCCheck: true + atcConfig: + checkVariant: ABAP_CLOUD_DEVELOPMENT_DEFAULT + + Release: + abapEnvironmentAssembleConfirm: true +``` + +### ATC Integration + +```yaml +stages: + Quality: + abapEnvironmentRunATCCheck: true + atcConfig: + checkVariant: ABAP_CLOUD_DEVELOPMENT_DEFAULT + failOn: ERROR + priorityFilter: + - '1' + - '2' +``` + +## Kyma CI/CD + +### Terraform Integration + +```hcl +# main.tf for Kyma provisioning +module "kyma" { + source = "github.com/SAP/terraform-module-kyma" + + subaccount_id = var.subaccount_id + cluster_name = "my-kyma-cluster" + region = "eu-central-1" +} +``` + +### Helm Deployment + +```yaml +stages: + Build: + containerBuild: true + dockerfilePath: Dockerfile + + Deploy: + helmDeploy: true + helmValues: + - ./chart/values.yaml + kubeConfigPath: ${KUBECONFIG} +``` + +## Security in CI/CD + +### Code Scanning + +```yaml +stages: + Security: + sonarQubeScan: true + sonarQubeConfig: + serverUrl: ${SONAR_URL} + projectKey: my-project + + dependencyTrackUpload: true + fortifyScan: true +``` + +### Secrets Management + +```yaml +# Using credentials +credentials: + - name: cf-credentials + type: usernamePassword + username: ${CF_USER} + password: ${CF_PASSWORD} + + - name: hana-credentials + type: usernamePassword + username: ${HANA_USER} + password: ${HANA_PASSWORD} +``` + +## Best Practices + +### Pipeline Design +1. Keep pipelines fast (< 15 minutes ideal) +2. Fail fast on critical issues +3. Use parallel stages where possible +4. Cache dependencies + +### Testing Strategy +```yaml +stages: + Unit Tests: + # Fast, run on every commit + npmScripts: ['test:unit'] + + Integration Tests: + # Slower, run on PR merge + npmScripts: ['test:integration'] + + E2E Tests: + # Slowest, run before release + npmScripts: ['test:e2e'] +``` + +### Environment Strategy + +| Environment | Trigger | Purpose | +|-------------|---------|---------| +| Development | Every push | Developer testing | +| QA | PR merge | QA testing | +| Staging | Release branch | Pre-production | +| Production | Manual approval | Live system | + +## Monitoring + +### Job Status +- View in CI/CD service UI +- Email notifications +- Webhook integrations + +### Metrics +- Build duration +- Success rate +- Test coverage +- Deployment frequency + +## Troubleshooting + +| Issue | Cause | Solution | +|-------|-------|----------| +| Build timeout | Long-running tests | Increase timeout, parallelize | +| Authentication failed | Expired credentials | Refresh tokens | +| Deployment failed | Resource quota | Check CF/Kyma limits | +| Test failures | Environment mismatch | Use consistent test data | + +## Learning Resources + +| Resource | Description | +|----------|-------------| +| "Exploring DevOps with SAP BTP" | SAP Learning course | +| "Efficient DevOps with SAP" | openSAP course | +| CI/CD Introduction Guide | Technical documentation | + +## Source Documentation + +- CI/CD Overview: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/continuous-integration-and-delivery-ci-cd-fe74df5.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/continuous-integration-and-delivery-ci-cd-fe74df5.md) +- CI/CD Introduction: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/introducing-continuous-integration-and-delivery-ci-cd-8ee5353.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/introducing-continuous-integration-and-delivery-ci-cd-8ee5353.md) +- SAP CI/CD Service: [https://help.sap.com/docs/continuous-integration-and-delivery](https://help.sap.com/docs/continuous-integration-and-delivery) diff --git a/references/connectivity.md b/references/connectivity.md new file mode 100644 index 0000000..60b63b2 --- /dev/null +++ b/references/connectivity.md @@ -0,0 +1,297 @@ +# SAP BTP Connectivity Reference + +## Overview + +SAP BTP provides comprehensive connectivity infrastructure for secure communication between cloud applications and various system types including on-premise systems, private clouds, and public cloud services. + +## Core Components + +### SAP Connectivity Service + +**Purpose**: Secure connections to on-premise and private cloud systems + +**Features:** +- Cloud Connector integration +- Connectivity Proxy support +- Multiple protocol support + +### Cloud Connector + +**Purpose**: Secure link between cloud and on-premise systems + +**Characteristics:** +- Operates as reverse proxy in secured networks +- Controlled resource access +- No inbound firewall rules required +- High availability configuration supported + +**Installation:** +- Windows or Linux +- Portable version available +- Master-shadow configuration for HA + +### Connectivity Proxy + +**Purpose**: Cloud-side counterpart to Cloud Connector + +**Supported Environments:** +- Cloud Foundry +- Kyma +- Native Kubernetes +- ABAP Environment + +### SAP Destination Service + +**Purpose**: Routing and authentication management + +**Capabilities:** +- Store connection properties +- Manage OAuth token flows +- Custom parameter handling +- Design-time configuration + +**Destination Types:** +| Type | Use Case | +|------|----------| +| HTTP | REST/OData APIs | +| RFC | SAP function calls | +| LDAP | Directory services | +| Mail | Email servers | + +### SAP Transparent Proxy + +**Purpose**: Simplify Kubernetes connectivity + +**Features:** +- Exposes target systems on local network +- Automates authentication +- Automatic destination retrieval +- Native Kubernetes integration + +## Connectivity Patterns + +### Cloud-to-Cloud + +**Use Cases:** +- Kubernetes to databases +- Application to SAP services +- OData endpoint consumption +- Third-party API integration + +**Implementation:** +```yaml +# destination configuration +- name: S4HANA_CLOUD + type: HTTP + url: [https://my-s4.cloud.sap](https://my-s4.cloud.sap) + authentication: OAuth2SAMLBearerAssertion + tokenServiceURL: [https://my-s4.cloud.sap/sap/bc/sec/oauth2/token](https://my-s4.cloud.sap/sap/bc/sec/oauth2/token) +``` + +### Cloud-to-On-Premise + +**Supported Systems:** +- ABAP systems (RFC, OData) +- Databases +- Mail servers +- FTP servers +- LDAP directories + +**User Propagation:** +- Principal propagation supported +- SSO via SAML/OAuth +- Technical user fallback + +**Configuration Steps:** +1. Install Cloud Connector +2. Connect to BTP subaccount +3. Map virtual hosts to internal systems +4. Configure destinations in BTP Cockpit + +### On-Premise-to-Cloud + +**Use Cases:** +- RFC callbacks from cloud +- Kubernetes cluster service access +- Event notifications + +## Destination Configuration + +### HTTP Destination (CAP) +```javascript +// package.json +{ + "cds": { + "requires": { + "API_BUSINESS_PARTNER": { + "kind": "odata-v2", + "model": "srv/external/API_BUSINESS_PARTNER", + "credentials": { + "destination": "S4HANA", + "path": "/sap/opu/odata/sap/API_BUSINESS_PARTNER" + } + } + } + } +} +``` + +### Destination in BTP Cockpit + +| Property | Value | Description | +|----------|-------|-------------| +| Name | S4HANA | Destination identifier | +| Type | HTTP | Protocol type | +| URL | [https://...](https://...) | Target system URL | +| Proxy Type | Internet/OnPremise | Connection type | +| Authentication | OAuth2SAMLBearerAssertion | Auth method | + +### Authentication Types + +| Type | Use Case | +|------|----------| +| NoAuthentication | Public APIs | +| BasicAuthentication | Technical users | +| OAuth2ClientCredentials | Server-to-server | +| OAuth2SAMLBearerAssertion | User propagation | +| OAuth2UserTokenExchange | Token exchange | +| PrincipalPropagation | SSO on-premise | +| ClientCertificateAuthentication | mTLS | + +## Cloud Connector Configuration + +### System Mapping + +``` +Cloud Configuration: + Virtual Host: s4hana.cloud + Virtual Port: 443 + +On-Premise Configuration: + Internal Host: s4hana.internal.corp + Internal Port: 44300 + Protocol: HTTPS +``` + +### Access Control + +- Define allowed resources +- Path-based filtering +- HTTP method restrictions + +### High Availability + +1. Install secondary Cloud Connector +2. Configure as shadow instance +3. Automatic failover + +## CAP Integration + +### Remote Service Configuration +```cds +// srv/external/API_BUSINESS_PARTNER.cds +using { API_BUSINESS_PARTNER as external } from './API_BUSINESS_PARTNER'; + +service RemoteService { + entity BusinessPartners as projection on external.A_BusinessPartner { + BusinessPartner, + BusinessPartnerFullName, + BusinessPartnerType + }; +} +``` + +### Service Implementation +```javascript +const cds = require('@sap/cds'); + +module.exports = cds.service.impl(async function() { + const bupa = await cds.connect.to('API_BUSINESS_PARTNER'); + + this.on('READ', 'BusinessPartners', async (req) => { + return bupa.run(req.query); + }); +}); +``` + +## ABAP Integration + +### Communication Arrangement + +1. Create Communication System +2. Define Communication Arrangement +3. Configure Authentication +4. Test Connection + +### Service Consumption Model + +```abap +" Generated proxy class usage +DATA(lo_client) = NEW /sap/bc/bupa/a_businesspartner( ). + +TRY. + DATA(lt_partners) = lo_client->get_business_partners( + iv_top = 100 + ). + CATCH cx_remote_call_error INTO DATA(lx_error). + " Handle error +ENDTRY. +``` + +### RFC Destination (SM59 equivalent) +- Configure in Communication Systems app +- Support for trusted RFC +- User propagation options + +## Kyma Connectivity + +### Transparent Proxy Deployment +```yaml +apiVersion: gateway.kyma-project.io/v1beta1 +kind: APIRule +metadata: + name: my-api +spec: + gateway: kyma-gateway.kyma-system.svc.cluster.local + host: my-api + rules: + - path: /.* + methods: ["GET", "POST"] + accessStrategies: + - handler: jwt +``` + +### Destination Binding +```yaml +apiVersion: services.cloud.sap.com/v1 +kind: ServiceBinding +metadata: + name: destination-binding +spec: + serviceInstanceName: destination-instance + secretName: destination-secret +``` + +## Best Practices + +1. **Use Transparent Proxy** for Kubernetes connectivity +2. **Design-time configuration** via Destination Service +3. **Connectivity Service** for hybrid cloud-to-on-premise +4. **Principal propagation** when user context needed +5. **Technical users** for batch/background processing +6. **High availability** Cloud Connector for production + +## Troubleshooting + +| Issue | Cause | Solution | +|-------|-------|----------| +| Connection timeout | Firewall blocking | Check Cloud Connector logs | +| Authentication failed | Token expired | Refresh OAuth configuration | +| Destination not found | Wrong name | Verify destination exists in subaccount | +| Certificate error | Untrusted CA | Import certificate in Cloud Connector | + +## Source Documentation + +- Connecting to Remote Systems: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/connecting-to-remote-systems-d61a5fc.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/connecting-to-remote-systems-d61a5fc.md) +- SAP Connectivity Service: [https://help.sap.com/docs/connectivity](https://help.sap.com/docs/connectivity) +- Cloud Connector: [https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/cloud-connector](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/cloud-connector) diff --git a/references/deployment.md b/references/deployment.md new file mode 100644 index 0000000..a2f7665 --- /dev/null +++ b/references/deployment.md @@ -0,0 +1,480 @@ +# SAP BTP Deployment Reference + +## Overview + +SAP BTP supports multiple deployment approaches depending on the runtime (Cloud Foundry, Kyma, or ABAP Environment) and application architecture. + +## Cloud Foundry Deployment + +### Multitarget Application (MTA) + +**Recommended for**: Complex applications with multiple modules and services + +#### Build and Deploy + +```bash +# Install MTA Build Tool +npm install -g mbt + +# Build MTA archive +mbt build + +# Deploy to Cloud Foundry +cf deploy mta_archives/my-app_1.0.0.mtar +``` + +#### mta.yaml Structure + +```yaml +_schema-version: "3.1" +ID: my-cap-app +version: 1.0.0 + +parameters: + enable-parallel-deployments: true + +modules: + # Backend service + - name: my-srv + type: nodejs + path: gen/srv + parameters: + buildpack: nodejs_buildpack + memory: 256M + requires: + - name: my-hana + - name: my-xsuaa + - name: my-destination + provides: + - name: srv-api + properties: + srv-url: ${default-url} + + # UI application + - name: my-app + type: approuter.nodejs + path: app/ + parameters: + memory: 256M + requires: + - name: srv-api + group: destinations + properties: + name: srv-api + url: ~{srv-url} + forwardAuthToken: true + - name: my-xsuaa + - name: my-html5-repo-runtime + + # Database deployer + - name: my-db-deployer + type: hdb + path: gen/db + parameters: + buildpack: nodejs_buildpack + requires: + - name: my-hana + +resources: + - name: my-hana + type: com.sap.xs.hdi-container + parameters: + service: hana + service-plan: hdi-shared + + - name: my-xsuaa + type: org.cloudfoundry.managed-service + parameters: + service: xsuaa + service-plan: application + path: ./xs-security.json + + - name: my-destination + type: org.cloudfoundry.managed-service + parameters: + service: destination + service-plan: lite + + - name: my-html5-repo-runtime + type: org.cloudfoundry.managed-service + parameters: + service: html5-apps-repo + service-plan: app-runtime +``` + +### Simple cf push + +**For**: Simple applications without complex dependencies + +```bash +# Deploy single application +cf push my-app -p ./dist -m 256M -b nodejs_buildpack +``` + +### manifest.yml + +```yaml +applications: + - name: my-app + memory: 256M + instances: 1 + buildpack: nodejs_buildpack + path: ./dist + routes: + - route: my-app.cfapps.eu10.hana.ondemand.com + services: + - my-xsuaa + - my-destination + env: + NODE_ENV: production +``` + +## Kyma Deployment + +### Helm Charts + +```bash +# Add Helm support to CAP +cds add helm + +# Deploy to Kyma +helm upgrade --install my-app ./chart \ + --namespace my-namespace \ + --set image.repository=my-registry/my-app \ + --set image.tag=1.0.0 +``` + +### Helm Chart Structure + +``` +chart/ +├── Chart.yaml +├── values.yaml +└── templates/ + ├── deployment.yaml + ├── service.yaml + ├── hpa.yaml + └── servicebinding.yaml +``` + +### values.yaml + +```yaml +replicaCount: 2 + +image: + repository: my-registry/my-app + tag: "1.0.0" + pullPolicy: IfNotPresent + +service: + type: ClusterIP + port: 8080 + +resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi + +autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 10 + targetCPUUtilization: 80 + +serviceBindings: + hana: + serviceInstanceName: my-hana + xsuaa: + serviceInstanceName: my-xsuaa +``` + +### Terraform for Kyma + +**Purpose**: Automate Kyma cluster provisioning via CI/CD pipelines for resource creation, deployment, testing, and teardown. + +**Key Resources:** +- **Terraform Provider for SAP BTP**: `SAP/btp` - Official SAP-maintained provider ([Terraform Registry](https://registry.terraform.io/providers/SAP/btp/latest/docs)) +- **Kyma Terraform Module**: `github.com/kyma-project/terraform-module` - Open-source module maintained by the Kyma project (SAP-backed) + +> **Note**: The Kyma Terraform module is an open-source project. Verify version compatibility and review the module documentation before production use. + +#### Prerequisites + +1. Terraform CLI on CI worker agents +2. Admin access (subaccount or global account level) +3. Dedicated Identity Authentication tenant +4. Technical user account + +#### Variables File (.tfvars) + +```hcl +# .tfvars - Store securely, use credential management +BTP_BOT_USER = "technical-user@example.com" +BTP_BOT_PASSWORD = "***" +BTP_GLOBAL_ACCOUNT = "global-account-subdomain" +BTP_BACKEND_URL = "[https://cpcli.cf.sap.hana.ondemand.com"](https://cpcli.cf.sap.hana.ondemand.com") +BTP_CUSTOM_IAS_TENANT = "custom-ias-tenant" +BTP_NEW_SUBACCOUNT_NAME = "my-subaccount" +BTP_NEW_SUBACCOUNT_REGION = "eu10" +BTP_KYMA_PLAN = "azure" +BTP_KYMA_REGION = "westeurope" +``` + +#### main.tf Configuration + +```hcl +# main.tf +terraform { + required_providers { + btp = { + source = "SAP/btp" + } + } +} + +provider "btp" { + globalaccount = var.globalaccount +} + +# Create Kyma environment using official module +module "kyma" { + source = "git::[https://github.com/kyma-project/terraform-module.git?ref=v0.3.1"](https://github.com/kyma-project/terraform-module.git?ref=v0.3.1") + + subaccount_id = var.subaccount_id + cluster_name = var.BTP_NEW_SUBACCOUNT_NAME + region = var.BTP_KYMA_REGION + + administrators = [ + "admin@example.com" + ] +} + +# Outputs +output "kubeconfig" { + value = module.kyma.kubeconfig + sensitive = true +} + +output "cluster_id" { + value = module.kyma.cluster_id +} + +output "domain" { + value = module.kyma.domain +} +``` + +#### Execution Commands + +```bash +# Initialize Terraform +terraform init + +# Apply configuration +terraform apply -var-file=.tfvars -auto-approve + +# Retrieve outputs +terraform output -raw cluster_id + +# Destroy resources when done +terraform destroy -var-file=.tfvars -auto-approve +``` + +**Security Recommendation**: Use credential management systems (e.g., HashiCorp Vault) for sensitive variables + +## ABAP Deployment + +### Software Components (gCTS) + +**Manage Software Components App:** + +1. Create software component +2. Clone to development system +3. Develop and release transport requests +4. Pull to test/production systems + +``` +Development Flow: +[Dev System] → Release TR → [Git Repository] → Pull → [Test System] → Pull → [Prod System] +``` + +### Partner Deployment + +#### Multitenant SaaS + +``` +Partner Global Account: +├── Provider Subaccount +│ ├── ABAP System (Development) +│ ├── ABAP System (Test) +│ └── ABAP System (Production) +│ └── Tenant 1 +│ └── Tenant 2 +│ └── Tenant N +``` + +**Subscription Process:** +1. Customer subscribes via SaaS Provisioning +2. Tenant automatically created +3. Customer receives access URL + +#### Add-on Product + +``` +Partner Global Account: +├── Development Subaccount +│ └── ABAP System (Dev) +├── Test Subaccount +│ └── ABAP System (Test) +└── Assembly Subaccount + └── ABAP System (Assembly) + +Customer Global Account: +└── Production Subaccount + └── ABAP System + Add-on +``` + +**Delivery via Landscape Portal:** +1. Build add-on product +2. Register in SAP Store +3. Customer installs via Landscape Portal + +### abapGit (Migration) + +**Use Cases:** +- On-premise to cloud migration +- System decommissioning +- Cross-account transfers + +**Not recommended for**: Standard production transports + +## SAP Cloud Transport Management + +### Configuration + +```yaml +# Integration with CI/CD +transport: + enabled: true + landscape: + - name: DEV + type: Cloud Foundry + - name: QA + type: Cloud Foundry + requires: DEV + - name: PROD + type: Cloud Foundry + requires: QA +``` + +### Transport Routes + +``` +DEV → QA → PROD + ↓ + [Manual Approval] +``` + +## Deployment Best Practices + +### Blue-Green Deployment + +```bash +# Deploy new version +cf push my-app-blue + +# Test blue deployment +# ... + +# Switch routes +cf map-route my-app-blue cfapps.eu10.hana.ondemand.com --hostname my-app +cf unmap-route my-app-green cfapps.eu10.hana.ondemand.com --hostname my-app +``` + +### Rolling Updates (Kyma) + +```yaml +# deployment.yaml +spec: + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 +``` + +### Environment Variables + +```yaml +# mta.yaml +modules: + - name: my-srv + properties: + NODE_ENV: production + LOG_LEVEL: info + # Don't hardcode secrets! +``` + +### Resource Sizing + +| Environment | Memory | Instances | +|-------------|--------|-----------| +| Development | 256M | 1 | +| QA | 512M | 2 | +| Production | 1G | 3+ | + +## Common Issues + +| Issue | Cause | Solution | +|-------|-------|----------| +| Memory exceeded | Insufficient allocation | Increase memory in mta.yaml | +| Service binding failed | Service not created | Create service first | +| Route conflict | Route already exists | Use unique hostname | +| Build failed | Missing dependencies | Check package.json | + +## Useful Commands + +### Cloud Foundry + +```bash +# View logs +cf logs my-app --recent + +# Scale application +cf scale my-app -i 3 -m 512M + +# Restart application +cf restart my-app + +# View environment +cf env my-app + +# Bind service +cf bind-service my-app my-service +``` + +### Kyma/Kubernetes + +```bash +# View pods +kubectl get pods -n my-namespace + +# View logs +kubectl logs -f deployment/my-app -n my-namespace + +# Scale deployment +kubectl scale deployment my-app --replicas=3 -n my-namespace + +# Describe pod +kubectl describe pod my-app-xxx -n my-namespace +``` + +## Source Documentation + +- Deploy (ABAP): [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/deploy-d7aec3c.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/deploy-d7aec3c.md) +- Terraforming Kyma: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/terraforming-kyma-runtimes-57c82ab.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/terraforming-kyma-runtimes-57c82ab.md) +- MTA Documentation: [https://help.sap.com/docs/btp/sap-business-technology-platform/multitarget-applications-in-cloud-foundry-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/multitarget-applications-in-cloud-foundry-environment) diff --git a/references/design-patterns.md b/references/design-patterns.md new file mode 100644 index 0000000..6a15b57 --- /dev/null +++ b/references/design-patterns.md @@ -0,0 +1,331 @@ +# SAP BTP Design Patterns Reference + +## Overview + +Design patterns provide guidance for creating superior user experiences, implementing secure architectures, and building well-modularized applications on SAP BTP. + +## User Experience Design + +### Core Principle + +Superior UX drives business value through: +- Improved productivity +- Better data quality +- Higher user adoption + +### Common Challenges + +| Challenge | Impact | +|-----------|--------| +| Information discovery | Users can't find data | +| Data fragmentation | Multiple systems to check | +| Excessive navigation | Wasted time | +| Poor error handling | User frustration | + +### Design Thinking + +**Approach**: Understand user needs through observation and feedback + +**Process:** +1. Empathize - Understand users +2. Define - Clarify problems +3. Ideate - Generate solutions +4. Prototype - Build quickly +5. Test - Validate with users + +**Motto**: "Fail fast, fail early" + +## Development Use Case Patterns + +### Process Automation + +**Type**: Low-code/no-code + +**Tool**: SAP Build Process Automation + +**Best For**: Business experts creating workflows + +### Web and Mobile Applications + +**Tool**: SAP Build Apps, MDK + +**Best For**: Cross-platform consumer applications + +### Full-Stack Development + +**Types:** +- Single-tenant applications +- Multitenant SaaS applications +- Tenant-specific extensions + +**Reference Apps:** +- Poetry Slam Manager (SaaS) +- Catering Management (Extension) +- Incident Management (Full-stack) + +## Technology Design + +### Modularization Benefits + +| Benefit | Description | +|---------|-------------| +| Maintainability | Easier to understand and modify | +| Testability | Independent unit testing | +| Scalability | Scale individual components | +| Reduced coupling | Changes don't cascade | +| Faster innovation | Independent development | + +### Domain-Driven Design (DDD) + +**When to Use**: Applications with 30+ use cases, complex domains + +**Recommended Approach (SAP BTP/CAP):** +1. **SAP One Domain Model**: Leverage SAP's standardized business data model for consistency across SAP solutions +2. **CAP Domain Modeling**: Use CDS for human-readable, business-aligned domain models +3. **Community Practices**: Apply EventStorming, bounded-context discovery for complex scenarios + +**Complexity Scoring Heuristic**: + +> **Note**: This scoring is a pragmatic heuristic to help decide when deeper DDD practices (EventStorming, bounded-context discovery) may provide value. Always validate triggers against domain expert input, non-functional requirements (performance, scalability), and team constraints before applying. + +| Criterion | Points | Consideration | +|-----------|--------|---------------| +| 30+ use cases | 2 | Scale indicator | +| Anticipated growth | 1 | Future complexity | +| Significant future changes | 2 | Maintainability needs | +| Novel domain | 2 | Unknown complexity | + +**Score 7+ points**: Consider deeper DDD practices + +**DDD Process** (8 steps from ddd-crew): +1. Align business goals +2. Discover domain +3. Decompose domain +4. Connect bounded contexts +5. Strategize models +6. Define domain events +7. Design bounded contexts +8. Evolve architecture + +**Resources:** +- SAP One Domain Model: [https://api.sap.com/sap-one-domain-model](https://api.sap.com/sap-one-domain-model) +- CAP Domain Modeling: [https://cap.cloud.sap/docs/guides/domain-modeling](https://cap.cloud.sap/docs/guides/domain-modeling) +- DDD Starter Modeling: [https://github.com/ddd-crew/ddd-starter-modelling-process](https://github.com/ddd-crew/ddd-starter-modelling-process) + +## CAP Design Principles + +### Domain-Driven Development + +- Collaborate with domain experts +- Use CDS for human-readable models +- Focus on business concepts + +### Out-of-the-Box Best Practices + +CAP provides automatic: +- OData service generation +- CRUD operations +- Authorization checks +- Audit logging + +### Platform Agnostic Design + +CAP abstracts: +- Deployment targets (CF, Kyma) +- Authentication methods +- Protocols (REST, OData, GraphQL) +- Database technologies +- Messaging systems + +## ABAP Design Principles + +### Model-Driven Architecture + +**Benefits:** +- Common architecture reduces boilerplate +- Patterns transfer across implementations +- Built-in mock frameworks +- Consistent code quality + +### Use Case Patterns + +**Customer Applications:** +- Decoupled lifecycles +- Independent workload management +- Hub scenarios + +**Partner Solutions:** +- Multitenant SaaS +- Add-on products + +**Other:** +- Mobile applications +- Business automation +- Code quality analysis + +## Security Design + +### Five Guidelines + +| Guideline | Focus | +|-----------|-------| +| Secure User Interfaces | SAP Fiori authentication, validation | +| Access Control Models | RBAC/ABAC with OAuth/OpenID Connect | +| API Security | OAuth 2.0, TLS encryption | +| Secure Extensibility | Isolate and validate custom logic | +| Domain Model Validation | Review CDS models for data protection | + +### Secure SDLC + +**Explore Phase:** +- Implement OWASP standards +- Train development teams +- Conduct risk assessments +- Plan compliance requirements + +**Discover Phase:** +- Map data flows +- Establish secure architecture +- Validate third-party services +- Incorporate security in prototypes + +**Design Phase:** +- Apply least privilege +- Implement defense in depth +- Validate inputs at boundaries + +## Microservices Patterns + +### When to Use + +**Benefits:** +- Independent scaling +- Technology flexibility +- Team autonomy + +**Considerations:** +- Increased complexity +- Network latency +- Distributed transactions + +### CAP Approach + +Start monolithic, extract services when: +- Different scaling needs +- Different team ownership +- Independent deployment required + +### Communication Patterns + +| Pattern | Use Case | +|---------|----------| +| Synchronous (REST/OData) | Real-time queries | +| Asynchronous (Events) | Decoupled processes | +| Event Sourcing | Audit requirements | + +## Database Design + +### CAP with CDS + +```cds +// Domain model +entity Orders { + key ID : UUID; + customer : Association to Customers; + items : Composition of many OrderItems on items.order = $self; + status : Status; +} + +entity OrderItems { + key ID : UUID; + order : Association to Orders; + product : Association to Products; + quantity : Integer; +} +``` + +### ABAP with CDS + +```abap +define root view entity ZI_Order + as select from zorder + composition [0..*] of ZI_OrderItem as _Items +{ + key order_uuid as OrderUUID, + customer_id as CustomerID, + _Items +} +``` + +## API Design + +### API-First Approach + +1. Design API before implementation +2. Use OpenAPI/OData specifications +3. Follow SAP API Style Guide +4. Publish to API Business Hub + +### Versioning Strategy + +``` +/api/v1/orders # Version 1 +/api/v2/orders # Version 2 (breaking changes) +``` + +## Testing Patterns + +### Test Pyramid + +``` + /\ + / \ E2E Tests (few) + /----\ + / \ Integration Tests (some) + /--------\ + / \ Unit Tests (many) + /------------\ +``` + +### CAP Testing + +```javascript +const cds = require('@sap/cds'); + +describe('OrderService', () => { + let srv; + + beforeAll(async () => { + srv = await cds.connect.to('OrderService'); + }); + + it('creates order', async () => { + const order = await srv.create('Orders', { + customerID: '123' + }); + expect(order.ID).toBeDefined(); + }); +}); +``` + +### ABAP Testing + +```abap +CLASS ltcl_order DEFINITION FOR TESTING. + METHODS test_create_order FOR TESTING. +ENDCLASS. + +CLASS ltcl_order IMPLEMENTATION. + METHOD test_create_order. + " Test implementation + cl_abap_unit_assert=>assert_not_initial( lv_order_id ). + ENDMETHOD. +ENDCLASS. +``` + +## Source Documentation + +- Design (CAP): [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/design-6bb7339.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/design-6bb7339.md) +- Design (ABAP): [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/design-314ae3e.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/design-314ae3e.md) +- Technology Design: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/technology-design-a5b8129.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/technology-design-a5b8129.md) +- UX Design: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/user-experience-design-323bd93.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/user-experience-design-323bd93.md) diff --git a/references/extensions.md b/references/extensions.md new file mode 100644 index 0000000..bdb1ad1 --- /dev/null +++ b/references/extensions.md @@ -0,0 +1,267 @@ +# SAP Solution Extensions Reference + +## Overview + +SAP BTP enables organizations to extend existing SAP solutions without disrupting core performance and business processes. Extensions can add new functionality while maintaining upgrade compatibility. + +## Extension Types + +### In-App Extensions + +**Definition**: Extend backend and UI directly within the SAP solution + +**Supported Products:** +- SAP SuccessFactors +- SAP S/4HANA Cloud +- SAP Cloud for Customer + +**Capabilities:** +- Custom fields +- Custom logic (BAdIs) +- UI adaptations +- Custom reports + +### Side-by-Side Extensions + +**Definition**: Additional functionality deployed on SAP BTP, integrated with SAP solutions + +**Advantages:** + +| Area | Benefit | +|------|---------| +| Business | Independent feature development | +| Technology | Modern cloud-native architecture | +| Operations | Separate lifecycle management | + +## Planning Recommendations + +1. **Start simple** - Begin with straightforward implementations +2. **Maintain focused digital core** - Keep core system clean +3. **Choose simplest approach** - Don't over-engineer +4. **Verify API/event availability** - Ensure integration points exist + +## Supported SAP Solutions + +### Solutions with Automated Configuration + +| Solution | Extension Service | +|----------|------------------| +| SAP S/4HANA Cloud | SAP S/4HANA Cloud Extensibility | +| SAP SuccessFactors | SAP SuccessFactors Extensibility | +| SAP Cloud for Customer | Standard extensibility service | +| SAP Commerce Cloud | Commerce Cloud extensibility | +| SAP Field Service Management | FSM extensibility | + +## Extension Use Cases + +### UI Enhancement + +**Scenario**: Build new SAP Fiori interfaces integrated with SAP solutions + +**Implementation:** +```javascript +// CAP service consuming S/4HANA API +const cds = require('@sap/cds'); + +module.exports = (srv) => { + srv.on('READ', 'BusinessPartners', async (req) => { + const s4 = await cds.connect.to('API_BUSINESS_PARTNER'); + return s4.run(req.query); + }); +}; +``` + +### Functionality Expansion + +**Scenario**: Connect multiple SAP solutions + +**Example**: Link SAP SuccessFactors employee data with SAP S/4HANA + +### Advanced Capabilities + +**Scenarios:** +- Add analytics dashboards +- Implement machine learning +- Enable IoT integration + +### Data Consolidation + +**Scenario**: Centralize insights across systems + +**Tools:** +- SAP Datasphere +- SAP Analytics Cloud +- Custom CAP aggregators + +### SaaS Ecosystems + +**Scenario**: Create multi-tenant extension applications for distribution + +**Considerations:** +- Subscription management +- Tenant isolation +- Key user extensibility + +## Implementation Patterns + +### Remote Service Integration (CAP) + +#### Step 1: Import Service Definition + +```bash +# Download API specification +cds import API_BUSINESS_PARTNER.edmx +``` + +#### Step 2: Configure Connection + +```json +// package.json +{ + "cds": { + "requires": { + "API_BUSINESS_PARTNER": { + "kind": "odata-v2", + "model": "srv/external/API_BUSINESS_PARTNER", + "credentials": { + "destination": "S4HANA" + } + } + } + } +} +``` + +#### Step 3: Implement Service + +```javascript +// srv/extension-service.js +const cds = require('@sap/cds'); + +module.exports = cds.service.impl(async function() { + const s4 = await cds.connect.to('API_BUSINESS_PARTNER'); + + this.on('READ', 'BusinessPartners', async (req) => { + return s4.run(req.query); + }); + + this.on('CREATE', 'LocalEntities', async (req) => { + // Local business logic + const data = req.data; + // Enrich with S/4HANA data + const bp = await s4.read('A_BusinessPartner').where({ BusinessPartner: data.partnerId }); + data.partnerName = bp[0]?.BusinessPartnerFullName; + return data; + }); +}); +``` + +### Event-Based Integration + +#### Event Subscription + +```cds +// srv/extension-service.cds +using { sap.s4.beh } from 'srv/external/OP_API_BUSINESS_PARTNER_SRV'; + +service ExtensionService { + // React to S/4HANA events + event BusinessPartnerChanged : { + BusinessPartner : String; + } +} +``` + +#### Event Handler + +```javascript +// srv/extension-service.js +module.exports = (srv) => { + srv.on('BusinessPartnerChanged', async (msg) => { + const { BusinessPartner } = msg.data; + console.log(`Business Partner ${BusinessPartner} changed`); + // Trigger local business logic + }); +}; +``` + +### Eventing via SAP Event Mesh + +```yaml +# mta.yaml +resources: + - name: my-event-mesh + type: org.cloudfoundry.managed-service + parameters: + service: enterprise-messaging + service-plan: default + config: + emname: my-namespace +``` + +## ABAP Extensions (On-Stack) + +### Developer Extensibility + +**Available In**: SAP S/4HANA Cloud, Private Edition + +**Capabilities:** +- Custom CDS views +- Custom RAP business objects +- Released API consumption + +### Key User Extensibility + +**Available In**: Multitenant SaaS applications + +**Capabilities:** +- UI adaptations +- Custom fields +- Business Add-Ins (BAdIs) +- Business configuration + +## Best Practices + +### Architecture + +| Principle | Description | +|-----------|-------------| +| Loose coupling | Use APIs/events, not direct DB access | +| Idempotent operations | Handle duplicate events gracefully | +| Error handling | Implement retry logic, circuit breakers | +| Security | Follow least privilege principle | + +### Development + +1. **Use mock servers** for development without production access +2. **Test with real data** before production deployment +3. **Monitor integration health** with SAP Cloud ALM +4. **Document APIs** for maintainability + +### Operations + +1. **Separate lifecycles** - Deploy extensions independently +2. **Version APIs** - Maintain compatibility during upgrades +3. **Monitor performance** - Track integration latency +4. **Plan for upgrades** - Test against SAP update schedules + +## Resources + +| Resource | URL | +|----------|-----| +| SAP Extensibility Explorer | [https://experience.sap.com/extensibility-explorer/](https://experience.sap.com/extensibility-explorer/) | +| Discovery Center Missions | [https://discovery-center.cloud.sap/](https://discovery-center.cloud.sap/) | +| CAP External Services | [https://cap.cloud.sap/docs/guides/using-services](https://cap.cloud.sap/docs/guides/using-services) | + +## Related Skill Guides + +| Topic | Reference | +|-------|-----------| +| Design Patterns | `references/design-patterns.md` - DDD, modularization | +| Security | `references/security.md` - Authentication, authorization | +| Operations | `references/operations.md` - Scaling, monitoring | +| Connectivity | `references/connectivity.md` - Remote services, destinations | + +## Source Documentation + +- Extending SAP Solutions: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/extending-existing-sap-solutions-using-sap-btp-40aa232.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/extending-existing-sap-solutions-using-sap-btp-40aa232.md) diff --git a/references/hana-cloud.md b/references/hana-cloud.md new file mode 100644 index 0000000..5312546 --- /dev/null +++ b/references/hana-cloud.md @@ -0,0 +1,271 @@ +# SAP HANA Cloud Reference + +## Overview + +SAP HANA Cloud is a cloud-native Database-as-a-Service forming the database management foundation of SAP BTP. It eliminates hardware management overhead and supports multiple data models. + +## Supported Data Models + +| Model | Use Case | +|-------|----------| +| Relational | Traditional OLTP/OLAP | +| Document | JSON storage | +| Geospatial | Location data | +| Vector | AI/ML applications | + +## Cost Optimization Features + +### Native Storage Extension (NSE) + +**Purpose**: Store infrequently accessed data on disk instead of in-memory + +**Benefits:** +- Reduced memory requirements +- Lower costs for cold data +- Automatic data tiering + +**NSE Advisor**: Provides data-driven suggestions for storage optimization + +### Elastic Compute Nodes (ECN) + +**Purpose**: On-demand computational scaling during peak workloads + +**Features:** +- Scheduled activation/deactivation +- Automatic scaling based on metrics +- ECN Advisors for usage pattern analysis + +### Table Partitioning + +**Purpose**: Divide large tables for better query performance + +**Benefits:** +- Parallel query processing +- Partition pruning +- Works on multi-host and single-host configurations + +### Native Multi-Tenancy + +**Capability**: Up to 1,000 isolated database tenants per instance + +**Use Case**: SaaS applications with tenant data isolation + +### Free Tier + +**Allocation**: 16GB memory at no cost via BTP + +**Benefits:** +- Development without trial limitations +- Upgrade path to paid plans +- Full feature access + +## CAP Integration + +### CDS-Based Modeling + +```cds +// db/schema.cds +namespace my.bookshop; + +entity Books { + key ID : UUID; + title : String(111); + stock : Integer; + price : Decimal(10, 2); +} +``` + +### Automatic Artifact Generation + +CAP uses CDS to: +- Define domain models +- Generate database artifacts automatically +- Support local, hybrid, and cloud deployments + +### Adding HANA Support + +```bash +# Add HANA to CAP project +cds add hana + +# Build for HANA +cds build --production + +# Deploy database +cds deploy --to hana +``` + +### Service Configuration + +```json +// package.json +{ + "cds": { + "requires": { + "db": { + "[production]": { + "kind": "hana" + }, + "[development]": { + "kind": "sqlite" + } + } + } + } +} +``` + +### HDI Container Configuration + +```yaml +# mta.yaml +resources: + - name: my-hana + type: com.sap.xs.hdi-container + parameters: + service: hana + service-plan: hdi-shared + config: + schema: MY_SCHEMA +``` + +## ABAP Environment Integration + +### Automatic Integration + +The SAP BTP ABAP environment automatically includes: +- Dedicated HANA Cloud instance +- ABAP-managed database access +- Native SQL support via ABAP SQL + +### Features + +| Feature | Description | +|---------|-------------| +| Native Storage Extensions | Extended disk storage | +| Database Indexes | Custom index creation | +| Partitioning | Table partitioning support | +| ABAP SQL Service | External access to data | + +### CDS Views in ABAP + +```abap +@AbapCatalog.viewEnhancementCategory: [#NONE] +@AccessControl.authorizationCheck: #NOT_REQUIRED +@EndUserText.label: 'Sales Order' +define view entity ZI_SalesOrder + as select from zsales_order +{ + key order_uuid as OrderUUID, + order_id as OrderID, + customer_id as CustomerID, + @Semantics.amount.currencyCode: 'CurrencyCode' + total_amount as TotalAmount, + currency_code as CurrencyCode +} +``` + +## Database Development + +### Native SQL in CAP (Node.js) + +```javascript +const cds = require('@sap/cds'); + +module.exports = (srv) => { + srv.on('customQuery', async (req) => { + const db = await cds.connect.to('db'); + const result = await db.run(` + SELECT * FROM my_bookshop_Books + WHERE stock > 0 + ORDER BY title + `); + return result; + }); +}; +``` + +### Stored Procedures + +```sql +-- db/src/procedures/calculateTotal.hdbprocedure +PROCEDURE "calculateTotal" ( + IN iv_order_id NVARCHAR(36), + OUT ov_total DECIMAL(15,2) +) +LANGUAGE SQLSCRIPT +SQL SECURITY INVOKER +READS SQL DATA +AS +BEGIN + SELECT SUM(quantity * price) INTO ov_total + FROM "my_bookshop_OrderItems" + WHERE order_id = :iv_order_id; +END; +``` + +### Calculation Views + +```xml + + + + +``` + +## Performance Optimization + +### Best Practices + +| Practice | Description | +|----------|-------------| +| Use NSE for cold data | Move infrequently accessed data to disk | +| Partition large tables | Improve query performance | +| Create appropriate indexes | Speed up common queries | +| Use calculation views | Optimize analytical queries | +| Leverage in-memory | Keep hot data in memory | + +### Monitoring + +**Tools:** +- SAP HANA Cockpit +- Technical Monitoring Cockpit (ABAP) +- SAP Cloud ALM + +**Key Metrics:** +- Memory utilization +- CPU usage +- Query performance +- Connection pool status + +## Backup and Recovery + +### Automatic Backups +- Continuous backup +- Point-in-time recovery +- Cross-region backup options + +### Recovery Options +- Self-service restore via HANA Cockpit +- SAP support for disaster recovery + +## Security + +### Data Encryption +- Encryption at rest +- Encryption in transit (TLS) +- Column-level encryption options + +### Access Control +- Database users and roles +- Row-level security via CDS +- Integration with XSUAA + +## Source Documentation + +- Data Persistence: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/data-persistence-using-usap-hana-cloud-f19c8e9.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/data-persistence-using-usap-hana-cloud-f19c8e9.md) +- SAP HANA Cloud: [https://help.sap.com/docs/hana-cloud](https://help.sap.com/docs/hana-cloud) +- CAP HANA Guide: [https://cap.cloud.sap/docs/guides/databases-hana](https://cap.cloud.sap/docs/guides/databases-hana) diff --git a/references/mta.md b/references/mta.md new file mode 100644 index 0000000..fc929f0 --- /dev/null +++ b/references/mta.md @@ -0,0 +1,308 @@ +# Multitarget Applications (MTA) Reference + +## Overview + +Multitarget Applications enable packaging multiple interconnected cloud components into a single deployable bundle, addressing the complexity of modern cloud applications. + +## Key Characteristics + +- Single archive with all modules and dependencies +- Deployable across multiple SAP BTP subaccounts +- Automated deployment in proper dependency order +- Integrated deployment descriptor (mta.yaml) + +## When to Use MTAs + +| Scenario | Recommendation | +|----------|----------------| +| Business app with multiple components | Use MTA | +| Dependencies on external resources (DB, messaging) | Use MTA | +| Need standardized configuration | Use MTA | +| Simple single-module app | Consider cf push | + +## Creation Options + +| Tool | Description | +|------|-------------| +| SAP Business Application Studio | Native MTA support | +| SAP Web IDE Full-Stack | Automatic descriptor maintenance | +| mbt (Command Line) | Java-based builder | +| CI/CD Pipelines | Automated archive generation | + +## MTA Structure + +``` +my-app/ +├── mta.yaml # Deployment descriptor +├── package.json # Node.js dependencies +├── xs-security.json # Security configuration +├── app/ # UI module +│ ├── webapp/ +│ └── package.json +├── srv/ # Service module +│ ├── src/ +│ └── package.json +└── db/ # Database module + ├── src/ + └── package.json +``` + +## mta.yaml Anatomy + +### Schema and Identification + +```yaml +_schema-version: "3.1" +ID: my-cap-app +version: 1.0.0 +description: My CAP Application +``` + +### Parameters + +```yaml +parameters: + enable-parallel-deployments: true + deploy_mode: html5-repo +``` + +### Modules + +```yaml +modules: + - name: my-srv + type: nodejs + path: gen/srv + parameters: + buildpack: nodejs_buildpack + memory: 256M + disk-quota: 512M + build-parameters: + builder: npm + requires: + - name: my-hana + - name: my-xsuaa + provides: + - name: srv-api + properties: + srv-url: ${default-url} +``` + +### Resources + +```yaml +resources: + - name: my-hana + type: com.sap.xs.hdi-container + parameters: + service: hana + service-plan: hdi-shared + + - name: my-xsuaa + type: org.cloudfoundry.managed-service + parameters: + service: xsuaa + service-plan: application + path: ./xs-security.json +``` + +## Module Types + +| Type | Description | +|------|-------------| +| nodejs | Node.js application | +| java | Java application | +| hdb | HANA database content | +| html5 | Static HTML5 content | +| approuter.nodejs | Application Router | +| com.sap.application.content | Generic content | + +## Resource Types + +| Type | Description | +|------|-------------| +| com.sap.xs.hdi-container | HDI container | +| org.cloudfoundry.managed-service | Managed service instance | +| org.cloudfoundry.existing-service | Existing service reference | +| org.cloudfoundry.user-provided-service | User-provided service | + +## Complete Example + +```yaml +_schema-version: "3.1" +ID: incident-management +version: 1.0.0 + +parameters: + enable-parallel-deployments: true + +build-parameters: + before-all: + - builder: custom + commands: + - npm ci + - npx cds build --production + +modules: + # Service module + - name: incident-srv + type: nodejs + path: gen/srv + parameters: + buildpack: nodejs_buildpack + memory: 256M + requires: + - name: incident-db + - name: incident-auth + - name: incident-destination + provides: + - name: srv-api + properties: + srv-url: ${default-url} + + # Database deployer + - name: incident-db-deployer + type: hdb + path: gen/db + parameters: + buildpack: nodejs_buildpack + requires: + - name: incident-db + + # UI Application + - name: incident-app + type: approuter.nodejs + path: app/ + parameters: + memory: 256M + requires: + - name: srv-api + group: destinations + properties: + name: srv-api + url: ~{srv-url} + forwardAuthToken: true + - name: incident-auth + - name: incident-html5-repo-runtime + + # UI content deployer + - name: incident-ui-deployer + type: com.sap.application.content + path: . + requires: + - name: incident-html5-repo-host + parameters: + content-target: true + build-parameters: + build-result: resources + requires: + - artifacts: + - nsincidents.zip + name: nsincidents + target-path: resources/ + + - name: nsincidents + type: html5 + path: app/incidents + build-parameters: + build-result: dist + builder: custom + commands: + - npm ci + - npm run build:cf + +resources: + - name: incident-db + type: com.sap.xs.hdi-container + parameters: + service: hana + service-plan: hdi-shared + + - name: incident-auth + type: org.cloudfoundry.managed-service + parameters: + service: xsuaa + service-plan: application + path: ./xs-security.json + config: + xsappname: incident-${org}-${space} + tenant-mode: dedicated + + - name: incident-destination + type: org.cloudfoundry.managed-service + parameters: + service: destination + service-plan: lite + + - name: incident-html5-repo-runtime + type: org.cloudfoundry.managed-service + parameters: + service: html5-apps-repo + service-plan: app-runtime + + - name: incident-html5-repo-host + type: org.cloudfoundry.managed-service + parameters: + service: html5-apps-repo + service-plan: app-host +``` + +## Build Commands + +```bash +# Install MTA Build Tool +npm install -g mbt + +# Build MTA archive +mbt build + +# Build with specific platform +mbt build -p cf + +# Build to specific directory +mbt build -t ./dist +``` + +## Deploy Commands + +```bash +# Install MTA plugin +cf install-plugin multiapps + +# Deploy +cf deploy mta_archives/my-app_1.0.0.mtar + +# Deploy with options +cf deploy my-app.mtar --version-rule ALL + +# Blue-green deployment +cf bg-deploy my-app.mtar + +# List deployed MTAs +cf mtas + +# Undeploy +cf undeploy my-app --delete-services +``` + +## Common Issues + +| Issue | Cause | Solution | +|-------|-------|----------| +| Service binding fails | Service not ready | Add dependency order | +| Memory exceeded | Insufficient allocation | Increase in mta.yaml | +| Build fails | Missing dependencies | Run npm ci first | +| Deploy timeout | Large application | Increase timeout | + +## Best Practices + +1. **Use build-parameters** for complex builds +2. **Enable parallel deployments** for faster deploys +3. **Externalize configuration** via variables +4. **Version your MTAs** semantically +5. **Test locally** before deploying + +## Source Documentation + +- Using MTAs: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/using-multitarget-applications-to-manage-dependencies-41184aa.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/using-multitarget-applications-to-manage-dependencies-41184aa.md) +- MTA Documentation: [https://help.sap.com/docs/btp/sap-business-technology-platform/multitarget-applications-in-cloud-foundry-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/multitarget-applications-in-cloud-foundry-environment) diff --git a/references/observability.md b/references/observability.md new file mode 100644 index 0000000..bfe0e09 --- /dev/null +++ b/references/observability.md @@ -0,0 +1,279 @@ +# SAP BTP Observability Reference + +## Overview + +SAP BTP observability operates through two interconnected layers: +- **Central Layer**: SAP Cloud ALM - unified strategic view +- **Local Layer**: SAP Cloud Logging - granular technical insights + +Both layers integrate through APIs and context-sensitive navigation using telemetry data (logs, metrics, traces). + +## OpenTelemetry Strategy + +SAP has standardized on OpenTelemetry as the industry standard for cloud-native observability. + +**Key Principles:** +- Standardized instrumentation across SAP and customer applications +- Open APIs for non-SAP data source integration +- Seamless data flow through managed collectors + +## SAP Cloud ALM + +**Included with**: Enterprise Support subscriptions + +**Provisioning**: Via SAP for Me + +### Capabilities + +| Feature | Description | +|---------|-------------| +| Real User Monitoring | Actual user experience tracking | +| Health Monitoring | System and application health | +| Integration Monitoring | Cross-system integration status | +| Exception Monitoring | Error tracking and analysis | +| Job Monitoring | Background job status | +| Automation Monitoring | Automated process tracking | +| Synthetic User Monitoring | Selenium-based availability tests | +| Business Service Management | End-to-end service health | +| Intelligent Event Processing | Automated event correlation | + +### Supported Platforms + +**SaaS Applications:** +- SAP S/4HANA Cloud +- SAP HANA Cloud +- SAP Analytics Cloud + +**PaaS Runtimes:** +- Cloud Foundry +- Kyma + +### Integration + +```yaml +# CAP configuration for Cloud ALM +cds: + requires: + cloud-alm: + kind: sap-cloud-alm + credentials: + destination: cloud-alm-api +``` + +## SAP Cloud Logging + +**Based on**: OpenSearch + +**Deployment**: Instance-based service + +### Capabilities + +| Feature | Description | +|---------|-------------| +| Log Analytics | Full-text search, structured queries | +| Distributed Tracing | Cross-microservice request tracking | +| Technology Monitoring | Runtime metrics (Java/Node.js) | +| Custom Telemetry | Application-specific metrics | +| Alerting | Threshold-based notifications | +| Dashboards | Custom visualizations | + +### Service Binding + +```yaml +# mta.yaml +resources: + - name: my-cloud-logging + type: org.cloudfoundry.managed-service + parameters: + service: cloud-logging + service-plan: standard + +modules: + - name: my-srv + requires: + - name: my-cloud-logging +``` + +### CAP Integration + +```javascript +// Automatic logging with CAP +const cds = require('@sap/cds'); +const LOG = cds.log('my-service'); + +module.exports = (srv) => { + srv.on('READ', 'Books', (req) => { + LOG.info('Reading books', { user: req.user.id }); + // Business logic + }); +}; +``` + +### Custom Metrics + +> **Note**: This snippet assumes a MeterProvider is already configured by the platform (e.g., SAP Cloud Logging SDK) or application bootstrap. When using SAP BTP services, the telemetry infrastructure typically provides this setup automatically. + +```javascript +const { metrics } = require('@opentelemetry/api'); + +// Assumes MeterProvider is registered by SAP Cloud Logging or platform setup +const meter = metrics.getMeter('my-app'); +const orderCounter = meter.createCounter('orders_created', { + description: 'Number of orders created' +}); + +// Increment counter +orderCounter.add(1, { customer_type: 'enterprise' }); +``` + +### Custom Traces +```javascript +const { trace } = require('@opentelemetry/api'); + +const tracer = trace.getTracer('my-app'); + +async function processOrder(orderId) { + const span = tracer.startSpan('process-order'); + span.setAttribute('order.id', orderId); + + try { + // Processing logic + span.setStatus({ code: SpanStatusCode.OK }); + } catch (error) { + span.setStatus({ code: SpanStatusCode.ERROR, message: error.message }); + throw error; + } finally { + span.end(); + } +} +``` + +## SAP Alert Notification + +**Purpose**: Route critical events to notification channels + +**Channels:** +- Email +- SMS +- Slack +- Microsoft Teams +- ServiceNow +- Custom webhooks + +### Configuration +```json +{ + "conditions": [ + { + "name": "critical-errors", + "propertyKey": "severity", + "predicate": "EQUALS", + "propertyValue": "CRITICAL" + } + ], + "actions": [ + { + "name": "notify-team", + "type": "SLACK", + "properties": { + "webhookUrl": "[https://hooks.slack.com/..."](https://hooks.slack.com/...") + } + } + ] +} +``` + +## ABAP Technical Monitoring Cockpit + +**Purpose**: On-stack analysis and optimization + +**Features:** +- System workload monitoring +- Resource consumption tracking +- Request statistics +- Outbound communication analysis +- SQL statement analysis +- Work process monitoring + +### Key Metrics + +| Metric | Description | +|--------|-------------| +| Dialog Response Time | Average transaction response | +| CPU Utilization | Application server CPU usage | +| Memory Consumption | Heap and stack usage | +| Database Time | SQL execution duration | +| Work Process Usage | Active vs. total processes | + +## Implementation by Runtime + +### Cloud Foundry + +```yaml +# manifest.yml +applications: + - name: my-app + env: + SAP_CLOUD_LOGGING_ENABLED: true + OTEL_EXPORTER_OTLP_ENDPOINT: "..." +``` + +### Kyma + +```yaml +apiVersion: telemetry.kyma-project.io/v1alpha1 +kind: LogPipeline +metadata: + name: my-logs +spec: + input: + application: + namespaces: + include: [my-namespace] + output: + http: + host: cloud-logging-endpoint +``` + +### ABAP Environment + +Automatic integration with: +- Technical Monitoring Cockpit +- SAP Cloud ALM +- Security Audit Log +- Application Logging + +## Best Practices + +### Logging +1. Use structured logging (JSON format) +2. Include correlation IDs for request tracing +3. Log at appropriate levels (DEBUG, INFO, WARN, ERROR) +4. Avoid logging sensitive data + +### Metrics +1. Define SLIs (Service Level Indicators) +2. Set up SLOs (Service Level Objectives) +3. Create dashboards for key metrics +4. Configure alerts for threshold breaches + +### Tracing +1. Propagate trace context across services +2. Add meaningful span attributes +3. Use semantic conventions +4. Sample appropriately in production + +## Learning Resources + +| Resource | Description | +|----------|-------------| +| Mission 4432/4718 | Implement Observability in CAP Application | +| Learning Journey | Cloud Foundry Observability | +| Expert Portal | SAP Cloud ALM Configuration | + +## Source Documentation + +- Observability: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/establish-end-to-end-observability-34065a4.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/establish-end-to-end-observability-34065a4.md) +- Observability Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-implement-observability-in-a-full-stack-cap-application-c5636db.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-implement-observability-in-a-full-stack-cap-application-c5636db.md) +- SAP Cloud ALM: [https://help.sap.com/docs/cloud-alm](https://help.sap.com/docs/cloud-alm) +- SAP Cloud Logging: [https://help.sap.com/docs/cloud-logging](https://help.sap.com/docs/cloud-logging) diff --git a/references/operations.md b/references/operations.md new file mode 100644 index 0000000..c34aecb --- /dev/null +++ b/references/operations.md @@ -0,0 +1,325 @@ +# SAP BTP Operations Reference + +## Overview + +Effective administration and operations ensure stable, efficient, and cost-optimized application performance in the cloud. + +## Administrator Responsibilities + +### User and Access Management + +**Tasks:** +- Identity management +- Organizational structure setup +- Quota allocation +- Role assignments + +**Tools:** +- SAP BTP Cockpit +- Identity Authentication Service +- Role Collections + +### Performance Monitoring + +**Key Metrics:** +- System runtime +- SQL query execution +- Background job status +- Response times +- Error patterns + +### Resource Management + +**Activities:** +- Monitor consumption patterns +- Adjust sizing configurations +- Leverage hibernation features +- Cost optimization + +### Lifecycle Oversight + +**Scope:** +- Custom application management +- Transport processes +- Add-on deployments +- Multi-tenant administration + +### Integration Assurance + +**Focus:** +- Data synchronization between cloud and on-premises +- API health monitoring +- Event processing status + +## Supporting Tools + +| Tool | Purpose | Environment | +|------|---------|-------------| +| SAP Fiori Launchpad | UI access, administration | All | +| SAP BTP Cockpit | Platform administration | All | +| Landscape Portal | Partner/SaaS management | ABAP | +| Technical Monitoring Cockpit | On-stack analysis | ABAP | +| SAP Cloud ALM | Central monitoring | All | +| ABAP Test Cockpit | Code quality | ABAP | + +## Run and Scale Operations + +### Core Principles + +1. **Continuous user feedback** - Optimize based on real usage +2. **Proactive monitoring** - Use SAP BTP observability tools +3. **Security integration** - Protect against emerging threats +4. **Compliance maintenance** - Regular security audits + +### Scaling Strategies + +#### Cloud Foundry + +**Horizontal Scaling:** +```bash +# Scale instances +cf scale my-app -i 5 + +# Scale memory +cf scale my-app -m 1G +``` + +**Auto-scaling:** +- Configure in BTP Cockpit +- Based on CPU/memory thresholds +- Schedule-based scaling + +**Availability Zones:** +- Automatic distribution across AZs +- Handle ~1/3 capacity loss during AZ failure + +#### Kyma + +**Horizontal Pod Autoscaler:** +```yaml +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: my-app-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: my-app + minReplicas: 2 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 +``` + +#### ABAP Environment + +**Elastic Scaling:** +- Manual ACU/HCU adjustment via BTP Cockpit +- Automatic scaling between 1 ACU and configured maximum +- 0.5 ACU increments + +**Decision Metrics:** +- CPU usage +- Memory consumption +- Active work process counts + +### Cost Optimization + +#### System Hibernation (ABAP) + +**Benefits:** +- Reduces costs to <5% of operational expenses +- Preserves HANA Cloud instance +- Automatic restart during maintenance + +**Management:** +- Via Landscape Portal +- Scheduled activation/deactivation +- Trial accounts auto-hibernate nightly + +#### Resource Right-Sizing + +| Environment | Recommendation | +|-------------|----------------| +| Development | Minimal resources, hibernation | +| Test | Moderate resources, scheduled scaling | +| Production | Right-sized, auto-scaling enabled | + +## Maintenance and Upgrades + +### ABAP Environment Updates + +**Downtime-Optimized Process:** + +| Phase | Status | Duration | +|-------|--------|----------| +| Preparation | System available | Variable | +| Takeover | Downtime | 10-40 minutes | +| Postprocessing | System available | Background | + +### Pre-Upgrade Option + +**Purpose:** Test custom applications before standard upgrades + +**Guidelines:** +- Non-development systems only +- Available 4 weeks before release +- Report issues via SAP support +- Validates existing applications (not early feature access) + +### Security Patching + +**Best Practices:** +1. Regularly apply security patches +2. Monitor dependency vulnerabilities +3. Test patches in non-production first +4. Maintain patch schedule + +## Secure Operations + +### Continuous Threat Monitoring + +**Tools:** +- SAP Cloud ALM +- SAP Cloud Logging +- Alert Notification Service + +**Actions:** +- Real-time anomaly detection +- Automated alerting +- Incident response procedures + +### Secure Auto-Scaling + +**CAP Multitenancy:** +- Built-in tenant isolation +- Resource management per tenant +- Secure scaling for SaaS + +### Security Audits + +**Schedule:** Periodic (quarterly recommended) + +**Scope:** +- Configuration review +- Compliance verification +- Vulnerability assessment + +### Data Protection + +**Requirements:** +- Privacy law compliance (GDPR, HIPAA) +- Secure data handling +- User consent management + +## Transport Management + +### gCTS (ABAP) + +**Flow:** +``` +Development → Test → Production + ↓ ↓ ↓ + Release Import Import +``` + +**Tools:** Manage Software Components app + +### SAP Cloud Transport Management (CAP) + +**Configuration:** +```yaml +transport: + landscape: + - name: DEV + - name: QA + requires: DEV + - name: PROD + requires: QA +``` + +## Monitoring Best Practices + +### Dashboards + +**Key Panels:** +- Application health +- Response times +- Error rates +- Resource utilization +- Integration status + +### Alerts + +**Configuration:** + +| Metric | Threshold | Action | +|--------|-----------|--------| +| Error rate | > 1% | Page on-call | +| Response time | > 2s | Warning email | +| Memory | > 80% | Auto-scale or alert | +| CPU | > 70% | Auto-scale or alert | + +### Log Management + +**Retention:** +- Development: 7 days +- Test: 14 days +- Production: 30+ days + +**Analysis:** +- Full-text search +- Structured queries +- Correlation with traces + +## Troubleshooting + +### Common Issues + +| Issue | Diagnosis | Resolution | +|-------|-----------|------------| +| High latency | Check traces | Optimize queries, scale | +| Memory pressure | Check heap usage | Increase memory, optimize code | +| Connection errors | Check destinations | Verify credentials, network | +| Failed jobs | Check job logs | Fix data issues, retry | + +### Useful Commands + +**Cloud Foundry:** +```bash +# Recent logs +cf logs my-app --recent + +# Application info +cf app my-app + +# Environment variables +cf env my-app + +# Events +cf events my-app +``` + +**Kyma:** +```bash +# Pod logs +kubectl logs -f deployment/my-app + +# Describe pod +kubectl describe pod my-app-xxx + +# Resource usage +kubectl top pods +``` + +## Source Documentation + +- Administrate and Operate: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/administrate-and-operate-f8fe432.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/administrate-and-operate-f8fe432.md) +- Run and Scale: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/run-and-scale-fcb51b5.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/run-and-scale-fcb51b5.md) +- Maintain and Upgrade: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/maintain-and-upgrade-d24bc66.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/maintain-and-upgrade-d24bc66.md) diff --git a/references/partners.md b/references/partners.md new file mode 100644 index 0000000..b152d03 --- /dev/null +++ b/references/partners.md @@ -0,0 +1,301 @@ +# SAP BTP Partner Development Reference + +## Overview + +SAP BTP provides deployment options for partners (ISVs) to build and deliver ABAP and CAP-based applications as products or SaaS offerings. + +## Deployment Models + +### Multitenant SaaS + +**Definition**: Cloud service operated in partner's global account + +**Characteristics:** +- Partner owns infrastructure +- Customers subscribe to service +- Partner manages operations, monitoring +- Customers get key-user extensibility + +**Advantages:** +- Single codebase for all customers +- Centralized operations +- Easy updates (deploy once) +- Lower per-customer costs at scale + +### Add-on Product + +**Definition**: Product installed in customer's ABAP environment + +**Characteristics:** +- Customer owns infrastructure +- Customer manages lifecycle +- Customer has full data control +- Developer extensibility available + +**Requirements:** +- SAP PartnerEdge Build contract +- Distribution via SAP Store +- Registered ABAP namespace + +## ABAP Partner Development + +### Landscape Portal + +**Purpose**: Central management for partner solutions + +**Capabilities:** + +| Feature | Description | +|---------|-------------| +| System Management | Create, configure ABAP systems | +| Tenant Management | SaaS tenant operations | +| Product Lifecycle | Build, register, publish products | +| Deployment Pipelines | CI/CD for ABAP | +| Monitoring | System and application health | + +### Software Components + +**Requirement**: At least one software component per solution + +**Rules:** +- Registered ABAP namespace mandatory +- Y*/Z* objects only within single global account +- Multiple global accounts require add-on products + +### Transport Mechanisms + +| Tool | Use Case | +|------|----------| +| gCTS | BTP system-to-system transports (recommended) | +| abapGit | On-premise migration, backup, cross-account | +| Landscape Portal Products | Multi-account delivery | + +### Namespace Requirements + +**Mandatory**: All objects in a Product require registered namespace + +**Process:** +1. Request namespace from SAP +2. Register in development system +3. Use namespace prefix for all objects + +## CAP Partner Development + +### Poetry Slam Manager + +**Type**: Reference application for multitenant CAP SaaS + +**GitHub**: [https://github.com/SAP-samples/partner-reference-application/](https://github.com/SAP-samples/partner-reference-application/) + +**Demonstrates:** +- Full-stack cloud applications using SAP Cloud Application Programming Model (CAP) +- Multitenant architecture aligned with SAP BTP Developer's Guide +- ERP-agnostic design (compatible with S/4HANA Cloud, Business One, Business ByDesign) +- Subscription lifecycle management +- Cost optimization patterns + +**Tutorial Structure:** +1. Core application development (business models, logic) +2. Enhancement to multitenant (multi-customer) solutions +3. ERP backend integration +4. Feature expansion +5. Application extension + +**Bill of Materials**: Complete service list at [https://github.com/SAP-samples/partner-reference-application/blob/main/Tutorials/01-BillOfMaterials.md](https://github.com/SAP-samples/partner-reference-application/blob/main/Tutorials/01-BillOfMaterials.md) + +### Partner Reference Application Extension + +**Type**: Customer-specific extension example + +**GitHub**: [https://github.com/SAP-samples/partner-reference-application-extension](https://github.com/SAP-samples/partner-reference-application-extension) + +**Demonstrates:** +- Enhanced catering management capabilities +- Seamless base application integration +- Granular tenant-specific configurations +- Consistent UX across extended and core features +- Secure multitenant architecture with data isolation + +## ABAP Sample Application + +### Music Festival Manager + +**Type**: Reference application for multitenant ABAP SaaS + +**GitHub**: [https://github.com/SAP-samples/abap-platform-partner-reference-application](https://github.com/SAP-samples/abap-platform-partner-reference-application) + +**Demonstrates:** +- Full-stack ABAP Cloud development using RAP +- Scalable, multitenant architecture +- SAP BTP Developer's Guide best practices +- ERP-agnostic design (side-by-side extensions) +- Compatibility with any SAP solution including S/4HANA Cloud ERP + +**Tutorial Structure:** +1. **Core Application Development**: Business models, logic, UI, authentication, role-based authorization +2. **Deployment & Provisioning**: Building and deploying to consumers +3. **SAP S/4HANA Cloud Integration**: Connecting with enterprise systems +4. **Feature Enhancement**: Expanding application capabilities + +**Key Features:** +- Uses ABAP RESTful Application Programming Model (RAP) +- Leverages SAP BTP services for enterprise-class standards +- Enables focus on business logic and domain functionality + +## Cost Estimation + +### Total Cost of Ownership Calculator + +**Location**: SAP Partner Portal + +**Inputs:** +- Expected tenant count +- Resource requirements +- Support level +- Region + +**Outputs:** +- Monthly operational costs +- Per-tenant estimates +- Scaling projections + +## Development Workflow + +### SaaS Development Flow + +``` +1. Setup + ├── Create global account + ├── Configure Landscape Portal + └── Setup development system + +2. Develop + ├── Build software components + ├── Implement business logic + ├── Create Fiori apps + └── Configure multitenancy + +3. Test + ├── Unit testing (ABAP Unit) + ├── Integration testing + ├── Tenant isolation testing + └── Performance testing + +4. Deploy + ├── Build product + ├── Register in Landscape Portal + └── Publish to SAP Store (optional) + +5. Operate + ├── Monitor via SAP Cloud ALM + ├── Manage subscriptions + └── Handle support requests +``` + +### Add-on Development Flow + +``` +1. Develop + ├── Create software components + ├── Use registered namespace + └── Follow ABAP Cloud guidelines + +2. Build + ├── Assemble product via Landscape Portal + ├── Run quality checks + └── Create release + +3. Distribute + ├── Register in SAP Store + ├── Define pricing + └── Enable discovery + +4. Support + ├── Customer installation support + ├── Update delivery + └── Issue resolution +``` + +## Key User Extensibility (SaaS) + +**Available to customers:** +- UI adaptations +- Custom fields +- Custom logic (BAdIs) +- Business configuration + +**Not available:** +- Database schema changes +- Core code modifications +- Direct system access + +## Tenant Management + +### Subscription Lifecycle + +``` +Customer Subscription Request + ↓ +Tenant Provisioning (automatic) + ↓ +Tenant Configuration + ↓ +User Access Setup + ↓ +Operational Phase + ↓ +[Optional] Tenant Offboarding +``` + +### Isolation Guarantees + +| Aspect | Isolation Level | +|--------|-----------------| +| Data | Complete (separate schemas) | +| Configuration | Per-tenant | +| Customizations | Per-tenant | +| Resources | Shared compute, isolated data | + +## Best Practices + +### Architecture + +1. **Design for multitenancy** from the start +2. **Implement proper tenant isolation** +3. **Use SAP-recommended patterns** +4. **Plan for scale** (up to 1000 tenants per HANA instance) + +### Development + +1. **Follow ABAP Cloud guidelines** +2. **Use ATC for quality checks** +3. **Implement comprehensive testing** +4. **Document APIs and extensions** + +### Operations + +1. **Monitor with SAP Cloud ALM** +2. **Automate deployments** +3. **Plan upgrade windows** +4. **Establish support processes** + +### Pricing + +1. **Calculate TCO accurately** +2. **Consider scaling costs** +3. **Plan for support overhead** +4. **Offer flexible pricing tiers** + +## Resources + +| Resource | Location | +|----------|----------| +| Partner Portal | partner.sap.com | +| Discovery Center | discovery-center.cloud.sap | +| PartnerEdge Build | SAP PartnerEdge program | +| Reference Applications | github.com/SAP-samples | + +## Source Documentation + +- ISV ABAP Guide: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/build-and-run-abap-applications-for-partners-who-are-independent-software-vendors-210db8e.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/build-and-run-abap-applications-for-partners-who-are-independent-software-vendors-210db8e.md) +- ISV SaaS Guide: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/build-and-run-multitenant-saas-applications-for-partners-who-are-independent-software-ven-9b5e06f.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/build-and-run-multitenant-saas-applications-for-partners-who-are-independent-software-ven-9b5e06f.md) diff --git a/references/resilience.md b/references/resilience.md new file mode 100644 index 0000000..e706f8e --- /dev/null +++ b/references/resilience.md @@ -0,0 +1,323 @@ +# SAP BTP Resilience Reference + +## Overview + +Building resilient applications ensures stability, high availability, and graceful degradation during failures. SAP BTP provides patterns and services to achieve enterprise-grade resilience. + +## Key Resources + +| Resource | Description | +|----------|-------------| +| Developing Resilient Apps on SAP BTP | Patterns and examples | +| Route Multi-Region Traffic | GitHub implementation | +| Architecting Multi-Region Resiliency | Discovery Center reference | + +## Cloud Foundry Resilience + +### Availability Zones + +**Automatic Distribution:** +- Applications spread across multiple AZs +- No manual configuration required +- Platform handles placement + +**During AZ Failure:** +- ~1/3 instances become unavailable (3-zone deployment) +- Remaining instances handle increased load +- Cloud Foundry reschedules to healthy zones + +**Best Practice:** +Configure sufficient instances to handle load during zone failures: +``` +Minimum instances = Normal load instances × 1.5 +``` + +### Instance Configuration + +```yaml +# manifest.yml +applications: + - name: my-app + instances: 3 # At least 3 for HA + memory: 512M + health-check-type: http + health-check-http-endpoint: /health +``` + +### Health Checks + +```javascript +// Express health endpoint +app.get('/health', (req, res) => { + const health = { + status: 'UP', + checks: { + database: checkDatabase(), + messaging: checkMessaging() + } + }; + res.status(200).json(health); +}); +``` + +## Kyma Resilience + +### Istio Service Mesh + +**Features:** +- Automatic retries +- Circuit breakers +- Timeouts +- Load balancing + +### Configuration + +```yaml +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: my-app-dr +spec: + host: my-app + trafficPolicy: + connectionPool: + tcp: + maxConnections: 100 + http: + h2UpgradePolicy: UPGRADE + http1MaxPendingRequests: 100 + http2MaxRequests: 1000 + outlierDetection: + consecutive5xxErrors: 5 + interval: 30s + baseEjectionTime: 30s + maxEjectionPercent: 50 +``` + +### Pod Distribution + +```yaml +apiVersion: apps/v1 +kind: Deployment +spec: + replicas: 3 + template: + spec: + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app: my-app +``` + +## ABAP Resilience + +### Built-in Features + +- Automatic workload distribution +- Work process management +- HANA failover support +- Session management + +### Elastic Scaling + +Automatic response to load: +- Scale between 1 ACU and configured max +- 0.5 ACU increments +- Metrics-based decisions + +## Resilience Patterns + +### Circuit Breaker + +**Purpose**: Prevent cascading failures + +**States:** +1. **Closed**: Normal operation +2. **Open**: Fail fast, skip calls +3. **Half-Open**: Test recovery + +**Implementation (CAP - Node.js):** + +> **Note**: The `opossum` library shown below is a third-party community package, not SAP-supported. Evaluate its maintenance status, compatibility with your CAP/Node.js versions, and security posture before production use. For Java applications, SAP Cloud SDK integrates with Resilience4j as the official resilience tooling. + +```javascript +const CircuitBreaker = require('opossum'); + +const breaker = new CircuitBreaker(callRemoteService, { + timeout: 3000, + errorThresholdPercentage: 50, + resetTimeout: 30000 +}); + +breaker.fallback(() => getCachedData()); + +const result = await breaker.fire(serviceParams); +``` + +### Retry with Exponential Backoff + +**Purpose**: Handle transient failures + +```javascript +async function retryWithBackoff(fn, maxRetries = 3) { + for (let i = 0; i < maxRetries; i++) { + try { + return await fn(); + } catch (error) { + if (i === maxRetries - 1) throw error; + const delay = Math.pow(2, i) * 1000; + await new Promise(r => setTimeout(r, delay)); + } + } +} +``` + +### Bulkhead + +**Purpose**: Isolate failures + +```javascript +const Semaphore = require('semaphore'); + +const dbPool = Semaphore(10); // Max 10 concurrent DB calls +const apiPool = Semaphore(20); // Max 20 concurrent API calls + +async function callDatabase() { + return new Promise((resolve, reject) => { + dbPool.take(() => { + performDbCall() + .then(resolve) + .catch(reject) + .finally(() => dbPool.leave()); + }); + }); +} +``` + +### Timeout + +**Purpose**: Prevent hanging requests + +```javascript +const timeout = (promise, ms) => { + return Promise.race([ + promise, + new Promise((_, reject) => + setTimeout(() => reject(new Error('Timeout')), ms) + ) + ]); +}; + +const result = await timeout(fetchData(), 5000); +``` + +### Graceful Degradation + +**Purpose**: Provide reduced functionality instead of failing + +```javascript +async function getProductDetails(id) { + try { + // Try full data + return await getFromPrimaryService(id); + } catch (error) { + // Fallback to cached/reduced data + const cached = await getFromCache(id); + if (cached) return { ...cached, _degraded: true }; + + // Final fallback + return getBasicDetails(id); + } +} +``` + +## Multi-Region Architecture + +### Active-Passive + +``` +Region A (Primary) Region B (Standby) + ↓ ↓ + Active Standby + ↓ ↓ + HANA Cloud HANA Cloud (Replica) +``` + +**Failover**: Manual or automated switch + +### Active-Active + +``` + Global Load Balancer + ↓ + ┌─────────┴─────────┐ + ↓ ↓ +Region A Region B + ↓ ↓ +HANA Cloud HANA Cloud + ↓ ↓ + └───── Replication ─┘ +``` + +**Use Case**: Highest availability requirements + +## Monitoring for Resilience + +### Key Metrics + +| Metric | Threshold | Action | +|--------|-----------|--------| +| Error rate | > 1% | Alert, investigate | +| Latency p99 | > 2s | Scale, optimize | +| Circuit breaker trips | Any | Review dependencies | +| Retry rate | > 5% | Check downstream services | + +### Alerting + +```yaml +# SAP Alert Notification example +conditions: + - name: high-error-rate + propertyKey: error_rate + predicate: GREATER_THAN + propertyValue: "0.01" + +actions: + - name: page-oncall + type: EMAIL + properties: + destination: oncall@example.com +``` + +## Best Practices + +### Design + +1. **Assume failure** - Everything can fail +2. **Design for graceful degradation** +3. **Implement health checks** +4. **Use async where possible** +5. **Plan for data consistency** + +### Implementation + +1. **Set timeouts** on all external calls +2. **Implement retries** with backoff +3. **Use circuit breakers** for dependencies +4. **Cache aggressively** where appropriate +5. **Log and monitor** all failures + +### Operations + +1. **Run chaos engineering** tests +2. **Practice disaster recovery** +3. **Monitor SLIs/SLOs** +4. **Automate failover** where possible + +## Source Documentation + +- Developing Resilient Applications: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/developing-resilient-applications-b1b929a.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/developing-resilient-applications-b1b929a.md) +- SAP BTP Resilience Guide: [https://help.sap.com/docs/btp/best-practices/developing-resilient-apps](https://help.sap.com/docs/btp/best-practices/developing-resilient-apps) diff --git a/references/runtimes.md b/references/runtimes.md new file mode 100644 index 0000000..a4763a7 --- /dev/null +++ b/references/runtimes.md @@ -0,0 +1,156 @@ +# SAP BTP Runtimes Comparison Reference + +## Overview + +SAP BTP provides flexible runtime options allowing development teams to select environments based on technical requirements, developer skills, and cost considerations. + +## Runtime Options + +### 1. Cloud Foundry Runtime + +**Best For**: Traditional PaaS applications, rapid deployment + +**Characteristics:** +- Managed application runtime +- Buildpack-based deployments +- Simple scaling with `cf scale` +- Memory-based billing + +**Languages:** +- Node.js +- Java +- Python +- Go +- PHP + +**Use Cases:** +- Cloud-native applications +- Microservices +- API backends +- Scheduled jobs + +### 2. Kyma Runtime + +**Best For**: Kubernetes-native applications, containerized workloads + +**Characteristics:** +- Managed Kubernetes cluster +- Istio service mesh included +- Helm-based deployments +- Container-based billing + +**Technologies:** +- Kubernetes +- Docker containers +- Helm charts +- Istio service mesh +- Serverless functions + +**Use Cases:** +- Container-based applications +- Microservices with service mesh +- Event-driven architectures +- Custom runtime requirements + +### 3. ABAP Environment + +**Best For**: Organizations with ABAP expertise, SAP extensions + +**Characteristics:** +- Managed ABAP platform +- RAP programming model +- Integrated SAP Fiori Launchpad +- ACU/HCU-based billing + +**Languages:** +- ABAP (restricted cloud-safe subset) + +**Use Cases:** +- SAP S/4HANA extensions +- Enterprise business applications +- Migrating ABAP custom code +- ISV solutions + +## Comparison Matrix + +| Aspect | Cloud Foundry | Kyma | ABAP Environment | +|--------|--------------|------|------------------| +| **Programming** | Node.js, Java, Python | Any containerized | ABAP Cloud | +| **Deployment** | cf push / MTA | Helm / kubectl | gCTS / Landscape Portal | +| **Scaling** | Horizontal (instances) | Kubernetes pods | Elastic ACUs | +| **Persistence** | HANA Cloud, PostgreSQL | HANA Cloud, any | HANA Cloud (managed) | +| **UI** | SAPUI5, Fiori Elements | Any | Fiori Elements | +| **Billing Model** | Memory consumption | Cluster + resources | ACU + HCU | + +## Metering Details + +### Cloud Foundry +- **Start**: When runtime memory is consumed (e.g., application deployment) +- **Metric**: GB-hours of memory +- **Optimization**: Stop unused applications, right-size memory + +### Kyma +- **Start**: When Kyma runtime is enabled (cluster creation) +- **Metric**: Dedicated Kubernetes cluster resources +- **Optimization**: Node autoscaling, resource limits + +### ABAP Environment +- **Start**: When ABAP system is provisioned +- **Metric**: ABAP Compute Units (ACU) + HANA Compute Units (HCU) +- **Optimization**: System hibernation, elastic scaling + +## Choosing a Runtime + +### Choose Cloud Foundry When: +- Developing CAP applications with Node.js or Java +- Need simple deployment model +- Want buildpack-managed dependencies +- Cost-sensitive workloads + +### Choose Kyma When: +- Need Kubernetes-native features +- Require service mesh (Istio) +- Building container-based microservices +- Need serverless functions +- Custom runtime requirements + +### Choose ABAP Environment When: +- Have existing ABAP expertise +- Extending SAP S/4HANA +- Need tight SAP integration +- Building partner add-on products +- Migrating custom ABAP code + +## CAP Support Across Runtimes + +### Cloud Foundry +```bash +# Deploy CAP to Cloud Foundry +mbt build +cf deploy mta_archives/my-app.mtar +``` + +### Kyma +```bash +# Deploy CAP to Kyma +cds add helm +helm upgrade --install my-app ./chart +``` + +### ABAP (Not CAP) +- Use RAP (ABAP RESTful Application Programming Model) +- Different programming model, similar concepts + +## Runtime-Specific Documentation + +| Runtime | Documentation | +|---------|--------------| +| Cloud Foundry | [https://help.sap.com/docs/btp/sap-business-technology-platform/cloud-foundry-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/cloud-foundry-environment) | +| Kyma | [https://help.sap.com/docs/btp/sap-business-technology-platform/kyma-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/kyma-environment) | +| ABAP | [https://help.sap.com/docs/btp/sap-business-technology-platform/abap-environment](https://help.sap.com/docs/btp/sap-business-technology-platform/abap-environment) | + +## Source Documentation + +- Runtime Benefits: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/strengths-and-benefits-of-the-runtimes-and-their-programming-models-86688d1.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/strengths-and-benefits-of-the-runtimes-and-their-programming-models-86688d1.md) +- CF/Kyma with CAP: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-cloud-foundry-and-sap-btp-kyma-runtimes-with-cap-0f9cfe9.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-cloud-foundry-and-sap-btp-kyma-runtimes-with-cap-0f9cfe9.md) +- ABAP Environment: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-abap-environment-with-abap-cloud-174b229.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/sap-btp-abap-environment-with-abap-cloud-174b229.md) diff --git a/references/security.md b/references/security.md new file mode 100644 index 0000000..7029345 --- /dev/null +++ b/references/security.md @@ -0,0 +1,327 @@ +# SAP BTP Security Reference + +## Overview + +Security must be integrated throughout the development lifecycle, from initial design through production operations. SAP BTP provides platform-level security with platform roles, segregation of duties, and audit logging with digital signatures. + +## Security by Development Phase + +### Explore Phase + +| Guideline | Action | +|-----------|--------| +| Secure SDLC Framework | Implement OWASP-aligned development standards | +| Engagement & Training | Clarify stakeholder expectations, train teams | +| Risk Assessment | Identify high-level security risks | +| Threat Modeling | Evaluate industry-specific threats | +| Compliance Planning | Determine applicable regulations (GDPR, HIPAA) | + +### Discover Phase + +| Guideline | Action | +|-----------|--------| +| Map Data Flows | Document sensitive data movement using OWASP Threat Dragon | +| Establish Secure Architecture | Microservice isolation, least privilege, defense-in-depth | +| Validate Third-Party Services | Review security certifications | +| Security in Prototypes | Include input sanitization, mock authentication | +| Plan Data Protection | Anonymize user research data | +| Understand Boundary Conditions | Assess IAM and audit logging integration | + +### Design Phase + +| Guideline | Focus | +|-----------|-------| +| Secure User Interfaces | SAP Fiori authentication and validation | +| Access Control Models | RBAC/ABAC using OpenID Connect/OAuth | +| API Security | OAuth and TLS encryption | +| Secure Extensibility | Isolate and validate custom logic | +| Domain Model Validation | Review CDS models for data protection | + +### Run and Scale Phase + +| Guideline | Focus | +|-----------|-------| +| Continuous Threat Monitoring | SAP BTP observability tools | +| Security Patching | Regular updates to dependencies | +| Secure Auto-Scaling | Tenant isolation in multitenancy | +| Security Audits | Periodic compliance reviews | +| Data Protection | Privacy law compliance | + +## Common Runtime Threats + +| Threat | Description | CAP Mitigation | +|--------|-------------|----------------| +| SQL Injection | Malicious SQL in inputs | Parameterized queries | +| XSS | Script injection in UI | Input validation | +| CSRF | Unauthorized actions | Built-in CSRF protection | +| Authentication Bypass | Improper session handling | XSUAA integration | + +## CAP Security Implementation + +### Authentication Setup + +```bash +# Add authentication +cds add xsuaa +``` + +### xs-security.json Configuration +```json +{ + "xsappname": "my-app", + "tenant-mode": "dedicated", + "scopes": [ + { + "name": "$XSAPPNAME.Read", + "description": "Read access" + }, + { + "name": "$XSAPPNAME.Write", + "description": "Write access" + }, + { + "name": "$XSAPPNAME.Admin", + "description": "Admin access" + } + ], + "role-templates": [ + { + "name": "Viewer", + "scope-references": ["$XSAPPNAME.Read"] + }, + { + "name": "Editor", + "scope-references": ["$XSAPPNAME.Read", "$XSAPPNAME.Write"] + }, + { + "name": "Administrator", + "scope-references": ["$XSAPPNAME.Read", "$XSAPPNAME.Write", "$XSAPPNAME.Admin"] + } + ] +} +``` + +### CDS Authorization + +```cds +// Role-based access control +service CatalogService @(requires: 'authenticated-user') { + + @(restrict: [ + { grant: 'READ', to: 'Viewer' }, + { grant: ['READ', 'WRITE'], to: 'Editor' }, + { grant: '*', to: 'Administrator' } + ]) + entity Books as projection on bookshop.Books; + + // Instance-based authorization + @(restrict: [ + { grant: 'READ', where: 'createdBy = $user' }, + { grant: '*', to: 'Administrator' } + ]) + entity Orders as projection on bookshop.Orders; +} +``` + +### Input Validation +```cds +entity Books { + key ID : UUID; + title : String(100) @mandatory; + price : Decimal(10,2) @assert.range: [0, 9999.99]; + isbn : String(13) @assert.format: '^[0-9]{13}$'; +} +``` + +## ABAP Security + +### Authorization Objects +```abap +AUTHORITY-CHECK OBJECT 'S_DEVELOP' + ID 'DEVCLASS' FIELD iv_package + ID 'OBJTYPE' FIELD 'CLAS' + ID 'ACTVT' FIELD '02'. + +IF sy-subrc <> 0. + RAISE EXCEPTION TYPE cx_no_authorization. +ENDIF. +``` + +### RAP Authorization +```abap +define behavior for ZI_Travel alias Travel +authorization master ( instance ) +{ + // Authorization check on entity level +} +``` + +### Behavior Implementation +```abap +METHOD get_instance_authorizations. + DATA(lv_auth) = abap_false. + + " Check authorization for specific instance + AUTHORITY-CHECK OBJECT 'ZTRAVEL' + ID 'TRAVEL_ID' FIELD keys[ 1 ]-TravelID + ID 'ACTVT' FIELD '02'. + + IF sy-subrc = 0. + lv_auth = abap_true. + ENDIF. + + result = VALUE #( FOR key IN keys + ( %tky = key-%tky + %update = COND #( WHEN lv_auth = abap_true THEN if_abap_behv=>auth-allowed + ELSE if_abap_behv=>auth-unauthorized ) ) ). +ENDMETHOD. +``` + +## Authentication Services + +### SAP Authentication and Trust Management (XSUAA) + +**Purpose**: Manage user authorizations + +**Features:** +- OAuth 2.0 / OpenID Connect +- SAML 2.0 federation +- User attribute mapping +- Role collections + +### Identity Authentication Service (IAS) + +**Purpose**: Cloud-based identity management + +**Features:** +- Single Sign-On (SSO) +- Multi-factor authentication +- Social login integration +- On-premise IdP integration + +### Configuration +```yaml +# mta.yaml +resources: + - name: my-xsuaa + type: org.cloudfoundry.managed-service + parameters: + service: xsuaa + service-plan: application + config: + xsappname: my-app + tenant-mode: dedicated + + - name: my-ias + type: org.cloudfoundry.managed-service + parameters: + service: identity + service-plan: application +``` + +## Secrets Management + +### SAP Credential Store (CAP) + +**Use Cases:** +- API keys +- Database credentials +- Third-party service tokens + +**Access via REST API:** +```javascript +const { CredentialStore } = require('@sap/credential-store'); + +const credStore = new CredentialStore(); +const password = await credStore.readPassword('namespace', 'key'); +``` + +### ABAP Communication Management + +- Integrated credentials store +- Outbound communication configuration +- Certificate management + +## Audit Logging + +### CAP Audit Log Service +```javascript +const cds = require('@sap/cds'); +const audit = cds.connect.to('audit-log'); + +// Log data access +await audit.log({ + type: 'DATA_READ', + data_subject: { type: 'Customer', id: customerId }, + attributes: ['name', 'email'] +}); +``` + +### ABAP Audit Logging + +**Security Audit Log:** +- Automatic for security-relevant events +- Configurable event classes + +**Read Access Logging (RAL):** +- Sensitive data access monitoring +- Compliance reporting + +## Data Privacy + +### SAP Data Privacy Integration + +**Capabilities:** +- Cross-application privacy features +- End-to-end compliance support +- Data subject access requests + +### Personal Data Handling (CAP) +```cds +entity Customers { + key ID : UUID; + @PersonalData.FieldSemantics: 'DataSubjectID' + customerID : String; + @PersonalData.IsPotentiallyPersonal + name : String; + @PersonalData.IsPotentiallyPersonal + email : String; +} +``` + +## Security Best Practices + +### Environment Configuration +- Restrict network access +- Use private endpoints where possible +- Enable WAF protection + +### Deployment Pipelines +- Code scanning in CI/CD +- Dependency vulnerability checks +- Container image scanning + +### Secrets +- Never hardcode credentials +- Rotate secrets regularly +- Use managed services + +### Network +- TLS 1.2+ for all connections +- Certificate pinning where appropriate +- IP allowlisting for sensitive services + +## Compliance Resources + +| Standard | SAP BTP Support | +|----------|-----------------| +| GDPR | Data Privacy Integration, audit logging | +| SOC 2 | SAP compliance certifications | +| ISO 27001 | Platform certifications | +| HIPAA | Healthcare-specific controls | + +## Source Documentation + +- Security Considerations: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/security-considerations-for-applications-a73f6ff.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/security-considerations-for-applications-a73f6ff.md) +- CAP Security Guide: [https://cap.cloud.sap/docs/guides/security/](https://cap.cloud.sap/docs/guides/security/) +- SAP BTP Security Recommendations: [https://help.sap.com/docs/btp/sap-btp-security-recommendations/sap-btp-security-recommendations](https://help.sap.com/docs/btp/sap-btp-security-recommendations/sap-btp-security-recommendations) diff --git a/references/setup.md b/references/setup.md new file mode 100644 index 0000000..a7e2193 --- /dev/null +++ b/references/setup.md @@ -0,0 +1,334 @@ +# SAP BTP Setup Reference + +## Overview + +Setting up SAP BTP landscape is an administrative task that involves configuring account structures, users, and infrastructure automation. + +## Account Model + +### Hierarchy + +``` +Global Account +├── Directory (optional) +│ ├── Subaccount (DEV) +│ ├── Subaccount (QA) +│ └── Subaccount (PROD) +└── Subaccount (Shared Services) +``` + +### Subaccount Configuration + +Each subaccount can have: +- Cloud Foundry environment +- Kyma environment +- ABAP environment +- Service instances +- Role assignments + +## User Types + +### Platform Users + +**Role**: Developers, administrators, operators + +**Responsibilities**: +- Application deployment +- System administration +- Troubleshooting +- Operations + +**Access**: Subaccounts, services, runtimes + +### Business Users + +**Role**: End users of applications + +**Access**: Deployed applications, SaaS services + +## Terraform Provider for SAP BTP + +### Overview + +**Purpose**: Automate provisioning, management, and configuration + +**Benefits**: +- Infrastructure as code +- Reproducible deployments +- Version-controlled configuration +- CI/CD integration + +### Installation + +```hcl +# main.tf +terraform { + required_providers { + btp = { + source = "SAP/btp" + version = "~> 1.0" + } + } +} + +provider "btp" { + globalaccount = var.globalaccount +} +``` + +### Common Resources + +#### Subaccount + +```hcl +resource "btp_subaccount" "dev" { + name = "development" + subdomain = "dev-${var.org_id}" + region = "eu10" + labels = { + environment = "development" + } +} +``` + +#### Entitlements + +```hcl +resource "btp_subaccount_entitlement" "hana" { + subaccount_id = btp_subaccount.dev.id + service_name = "hana-cloud" + plan_name = "hana" + amount = 1 +} + +resource "btp_subaccount_entitlement" "cf" { + subaccount_id = btp_subaccount.dev.id + service_name = "APPLICATION_RUNTIME" + plan_name = "MEMORY" +} +``` + +#### Service Instances + +```hcl +resource "btp_subaccount_service_instance" "xsuaa" { + subaccount_id = btp_subaccount.dev.id + name = "my-xsuaa" + serviceplan_id = data.btp_subaccount_service_plan.xsuaa.id + parameters = jsonencode({ + xsappname = "my-app" + tenant-mode = "dedicated" + }) +} +``` + +#### Role Collections + +```hcl +resource "btp_subaccount_role_collection_assignment" "admin" { + subaccount_id = btp_subaccount.dev.id + role_collection_name = "Subaccount Administrator" + user_name = "admin@example.com" +} +``` + +### Complete Example + +```hcl +# variables.tf +variable "globalaccount" { + description = "Global account subdomain" + type = string +} + +variable "region" { + description = "BTP region" + type = string + default = "eu10" +} + +variable "admins" { + description = "List of admin users" + type = list(string) +} + +# main.tf +terraform { + required_providers { + btp = { + source = "SAP/btp" + version = "~> 1.0" + } + } +} + +provider "btp" { + globalaccount = var.globalaccount +} + +# Development subaccount +resource "btp_subaccount" "dev" { + name = "Development" + subdomain = "dev-myorg" + region = var.region +} + +# Enable Cloud Foundry +resource "btp_subaccount_entitlement" "cf" { + subaccount_id = btp_subaccount.dev.id + service_name = "APPLICATION_RUNTIME" + plan_name = "MEMORY" +} + +resource "btp_subaccount_environment_instance" "cf" { + subaccount_id = btp_subaccount.dev.id + name = "cf-dev" + environment_type = "cloudfoundry" + service_name = "cloudfoundry" + plan_name = "standard" + parameters = jsonencode({ + instance_name = "cf-dev" + }) +} + +# HANA Cloud +resource "btp_subaccount_entitlement" "hana" { + subaccount_id = btp_subaccount.dev.id + service_name = "hana-cloud" + plan_name = "hana" + amount = 1 +} + +# Admin role assignment +resource "btp_subaccount_role_collection_assignment" "admins" { + for_each = toset(var.admins) + + subaccount_id = btp_subaccount.dev.id + role_collection_name = "Subaccount Administrator" + user_name = each.value +} + +# outputs.tf +output "subaccount_id" { + value = btp_subaccount.dev.id +} + +output "cf_api_endpoint" { + value = btp_subaccount_environment_instance.cf.labels["API Endpoint"] +} +``` + +### Terraform Commands + +```bash +# Initialize +terraform init + +# Plan changes +terraform plan -var-file="dev.tfvars" + +# Apply changes +terraform apply -var-file="dev.tfvars" + +# Destroy resources +terraform destroy -var-file="dev.tfvars" +``` + +## Manual Setup Steps + +### 1. Global Account Configuration + +1. Access SAP BTP Cockpit +2. Navigate to Global Account +3. Configure directories (optional) +4. Set up entitlements + +### 2. Subaccount Creation + +1. Click "Create Subaccount" +2. Specify name and subdomain +3. Select region +4. Configure labels +5. Enable environments + +### 3. Entitlement Assignment + +1. Navigate to Entitlements +2. Configure Service Assignments +3. Set quotas per service +4. Assign to subaccounts + +### 4. User Management + +1. Navigate to Security > Users +2. Add users by email +3. Assign role collections +4. Configure IdP trust (optional) + +## ABAP System Landscape Setup + +### Recommended Landscapes + +Start with only needed systems. Additional systems can be provisioned later. + +**3-System Landscape (DEV, QAS, PRD)** +- Recommended for most projects +- Suitable when development is occasional or release cycles are less frequent +- Enables testing outside development +- Verifies application behavior before production + +**5-System Landscape (DEV, COR, TST, QAS, PRD)** +- Appropriate for larger teams with continuous development +- Enables parallel correction handling +- Supports uninterrupted development work + +### Sizing Specifications + +**Production Capacity:** +- 1 ACU can serve up to **1,000 active business users per day** + +**Recommended Minimum Starting Configuration:** + +| Resource | Size | Memory | +|----------|------|--------| +| ABAP Compute Units (ACU) | 1 | 16 GB | +| HANA Compute Units (HCU) | 2 | 32 GB total | + +**Scaling Options:** +- Manual scaling via SAP BTP Cockpit +- Automatic runtime scaling (Release 2402+) requires consumption-based contract + +**Cost Optimization:** +- Use system hibernation for DEV, COR, TST systems during inactive periods +- Reduces costs significantly when systems not in use + +## Best Practices + +### Account Structure + +| Environment | Purpose | Entitlements | +|-------------|---------|--------------| +| Development | Development work | Full entitlements | +| QA/Test | Testing | Production-like | +| Production | Live workloads | Production quotas | +| Sandbox | Experimentation | Minimal | + +### Security + +1. **Least privilege** - Minimal necessary permissions +2. **Separation of duties** - Different roles for different tasks +3. **Audit logging** - Enable for compliance +4. **IdP integration** - Use corporate identity + +### Automation + +1. **Use Terraform** for reproducibility +2. **Version control** configurations +3. **CI/CD integration** for changes +4. **Document** manual steps + +## Source Documentation + +- Setup: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/set-up-3b774f8.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/set-up-3b774f8.md) +- SAP BTP Administrator's Guide: [https://help.sap.com/docs/btp/sap-business-technology-platform/administration-and-operations](https://help.sap.com/docs/btp/sap-business-technology-platform/administration-and-operations) +- Terraform Provider: [https://registry.terraform.io/providers/SAP/btp/latest](https://registry.terraform.io/providers/SAP/btp/latest) diff --git a/references/testing.md b/references/testing.md new file mode 100644 index 0000000..fe8e695 --- /dev/null +++ b/references/testing.md @@ -0,0 +1,400 @@ +# SAP BTP Testing Reference + +## Overview + +Quality assurance requires comprehensive testing across multiple dimensions including UI, usability, performance, and unit testing. + +## Testing Strategy + +### Test Pyramid + +``` + /\ + / \ E2E/UI Tests (few, slow) + /----\ + / \ Integration Tests (some) + /--------\ + / \ Unit Tests (many, fast) + /------------\ +``` + +### Benefits of Unit Testing + +- Detect issues fast +- Better maintainable code +- More understandable code +- CI/CD integration +- Regression prevention + +## CAP Testing + +### Jest Setup + +```javascript +// package.json +{ + "scripts": { + "test": "jest", + "test:watch": "jest --watch", + "test:coverage": "jest --coverage" + }, + "devDependencies": { + "jest": "^29.0.0", + "@sap/cds-dk": "^7.0.0" + } +} +``` + +### Unit Test Example + +```javascript +// test/unit/catalog-service.test.js +const cds = require('@sap/cds'); + +describe('CatalogService', () => { + let srv; + + beforeAll(async () => { + srv = await cds.connect.to('CatalogService'); + }); + + afterAll(async () => { + await cds.disconnect(); + }); + + describe('READ Books', () => { + it('should return all books', async () => { + const books = await srv.read('Books'); + expect(books).toBeDefined(); + expect(Array.isArray(books)).toBe(true); + }); + + it('should filter by title', async () => { + const books = await srv.read('Books').where({ title: 'Test Book' }); + expect(books.length).toBeLessThanOrEqual(1); + }); + }); + + describe('CREATE Books', () => { + it('should create a book', async () => { + const book = await srv.create('Books', { + title: 'New Book', + stock: 10 + }); + expect(book.ID).toBeDefined(); + expect(book.title).toBe('New Book'); + }); + + it('should reject invalid data', async () => { + await expect(srv.create('Books', {})) + .rejects.toThrow(); + }); + }); +}); +``` + +### Integration Test Example + +```javascript +// test/integration/api.test.js +const cds = require('@sap/cds'); +const { GET, POST, PATCH, DELETE } = cds.test(__dirname + '/..'); + +describe('API Integration', () => { + it('GET /catalog/Books', async () => { + const { status, data } = await GET('/catalog/Books'); + expect(status).toBe(200); + expect(data.value).toBeDefined(); + }); + + it('POST /catalog/Books', async () => { + const { status, data } = await POST('/catalog/Books', { + title: 'Test Book', + stock: 5 + }); + expect(status).toBe(201); + expect(data.ID).toBeDefined(); + }); + + it('GET /catalog/Books/:id', async () => { + const { data: created } = await POST('/catalog/Books', { title: 'Test' }); + const { status, data } = await GET(`/catalog/Books(${created.ID})`); + expect(status).toBe(200); + expect(data.title).toBe('Test'); + }); +}); +``` + +## SAPUI5 Testing + +### QUnit Framework + +**Best Practice**: Write small, focused tests + +```javascript +// webapp/test/unit/model/formatter.js +sap.ui.define([ + "my/app/model/formatter" +], function(formatter) { + "use strict"; + + QUnit.module("formatter"); + + QUnit.test("formatStatus", function(assert) { + assert.strictEqual( + formatter.formatStatus("OPEN"), + "Open", + "Status formatted correctly" + ); + }); + + QUnit.test("formatDate", function(assert) { + const date = new Date("2024-01-15"); + assert.strictEqual( + formatter.formatDate(date), + "Jan 15, 2024", + "Date formatted correctly" + ); + }); +}); +``` + +### OPA5 Integration Tests + +```javascript +// webapp/test/integration/pages/List.js +sap.ui.define([ + "sap/ui/test/Opa5", + "sap/ui/test/actions/Press" +], function(Opa5, Press) { + "use strict"; + + Opa5.createPageObjects({ + onTheListPage: { + actions: { + iPressOnFirstItem: function() { + return this.waitFor({ + controlType: "sap.m.ObjectListItem", + success: function(aItems) { + new Press().executeOn(aItems[0]); + } + }); + } + }, + assertions: { + iShouldSeeTheList: function() { + return this.waitFor({ + id: "list", + success: function() { + Opa5.assert.ok(true, "List is visible"); + } + }); + } + } + } + }); +}); +``` + +### OPA5 Journey + +```javascript +// webapp/test/integration/AllJourneys.js +sap.ui.define([ + "sap/ui/test/Opa5", + "./pages/List", + "./ListJourney" +], function(Opa5) { + "use strict"; + + Opa5.extendConfig({ + viewNamespace: "my.app.view.", + autoWait: true + }); +}); + +// webapp/test/integration/ListJourney.js +sap.ui.define([ + "sap/ui/test/opaQunit" +], function(opaTest) { + "use strict"; + + QUnit.module("List Journey"); + + opaTest("Should see the list", function(Given, When, Then) { + Given.iStartMyApp(); + Then.onTheListPage.iShouldSeeTheList(); + Given.iTeardownMyApp(); + }); + + opaTest("Should navigate to detail", function(Given, When, Then) { + Given.iStartMyApp(); + When.onTheListPage.iPressOnFirstItem(); + Then.onTheDetailPage.iShouldSeeTheDetail(); + Given.iTeardownMyApp(); + }); +}); +``` + +## ABAP Testing + +### ABAP Unit + +```abap +CLASS ltcl_travel DEFINITION FINAL FOR TESTING + DURATION SHORT + RISK LEVEL HARMLESS. + + PRIVATE SECTION. + CLASS-DATA: mo_environment TYPE REF TO if_cds_test_environment. + DATA: mo_cut TYPE REF TO zcl_travel_handler. + + CLASS-METHODS class_setup. + CLASS-METHODS class_teardown. + METHODS setup. + METHODS test_validate_dates FOR TESTING. + METHODS test_calculate_total FOR TESTING. +ENDCLASS. + +CLASS ltcl_travel IMPLEMENTATION. + + METHOD class_setup. + mo_environment = cl_cds_test_environment=>create( + i_for_entity = 'ZI_TRAVEL' + ). + ENDMETHOD. + + METHOD class_teardown. + mo_environment->destroy( ). + ENDMETHOD. + + METHOD setup. + mo_environment->clear_doubles( ). + mo_cut = NEW #( ). + ENDMETHOD. + + METHOD test_validate_dates. + " Given + DATA(lv_begin) = cl_abap_context_info=>get_system_date( ). + DATA(lv_end) = lv_begin + 7. + + " When + DATA(lv_valid) = mo_cut->validate_dates( + iv_begin = lv_begin + iv_end = lv_end + ). + + " Then + cl_abap_unit_assert=>assert_true( lv_valid ). + ENDMETHOD. + + METHOD test_calculate_total. + " Given + DATA(lv_booking_fee) = CONV decfloat16( '50.00' ). + DATA(lv_price) = CONV decfloat16( '500.00' ). + + " When + DATA(lv_total) = mo_cut->calculate_total( + iv_booking_fee = lv_booking_fee + iv_price = lv_price + ). + + " Then + cl_abap_unit_assert=>assert_equals( + exp = '550.00' + act = lv_total + ). + ENDMETHOD. + +ENDCLASS. +``` + +### CDS Test Double Framework + +```abap +" Create test doubles for CDS entities +DATA(lo_env) = cl_cds_test_environment=>create( + i_for_entity = 'ZI_TRAVEL' +). + +" Insert test data +DATA: lt_travel TYPE TABLE OF ztravel. +lt_travel = VALUE #( + ( travel_uuid = cl_uuid_factory=>create_uuid_c32( ) + travel_id = '1' + customer_id = 'CUST001' + begin_date = '20240101' + end_date = '20240108' ) +). +lo_env->insert_test_data( lt_travel ). + +" Run tests... + +" Clear after tests +lo_env->clear_doubles( ). +``` + +## Test Automation + +### CI/CD Integration + +```yaml +# .pipeline/config.yml +stages: + Additional Unit Tests: + npmExecuteScripts: true + npmScripts: + - test + + Integration Tests: + npmExecuteScripts: true + npmScripts: + - test:integration + + UI Tests: + karmaExecuteTests: true +``` + +### Code Coverage + +```javascript +// jest.config.js +module.exports = { + collectCoverage: true, + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80 + } + } +}; +``` + +## Best Practices + +### Unit Tests +1. Test one thing at a time +2. Use descriptive names +3. Follow AAA pattern (Arrange, Act, Assert) +4. Mock external dependencies +5. Keep tests fast + +### Integration Tests +1. Test real interactions +2. Use test data that represents production +3. Clean up after tests +4. Test error paths + +### UI Tests +1. Test user journeys +2. Use page objects pattern +3. Keep tests maintainable +4. Test accessibility + +## Source Documentation + +- Testing: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/performing-ui-usability-and-unit-tests-50a7c7d.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/performing-ui-usability-and-unit-tests-50a7c7d.md) +- SAPUI5 Testing: [https://sapui5.hana.ondemand.com/#/topic/291c9121e6044ab381e0b51716f97f52](https://sapui5.hana.ondemand.com/#/topic/291c9121e6044ab381e0b51716f97f52) +- CAP Testing: [https://cap.cloud.sap/docs/node.js/cds-test](https://cap.cloud.sap/docs/node.js/cds-test) diff --git a/references/tools.md b/references/tools.md new file mode 100644 index 0000000..3c06ab9 --- /dev/null +++ b/references/tools.md @@ -0,0 +1,306 @@ +# SAP BTP Development Tools Reference + +## Development Environments + +### SAP Business Application Studio + +**Type**: Cloud-based IDE optimized for SAP development + +**Foundation**: Code-OSS (VS Code base) + +**Capabilities:** +- SAP Fiori application development +- CAP application development +- HANA database extensions +- Full-stack development +- Mobile development + +**Dev Spaces:** + +| Dev Space | Purpose | +|-----------|---------| +| Full Stack Cloud Application | CAP, Fiori, HANA | +| SAP Fiori | Fiori Elements, Freestyle | +| SAP HANA Native Application | HDI containers, calculation views | +| SAP Mobile Application | Mobile Development Kit | +| Basic | General development | + +### ABAP Development Tools (ADT) + +**Type**: Eclipse-based IDE for ABAP development + +**Capabilities:** +- ABAP Cloud development +- RAP business objects +- CDS view modeling +- ABAP unit testing +- ATC integration + +**Installation:** +1. Download Eclipse IDE +2. Install ADT from SAP update site +3. Connect to ABAP system + +### SAP Build + +**Type**: Low-code/no-code platform + +**Components:** +- **SAP Build Apps**: Drag-and-drop application creation +- **SAP Build Process Automation**: Workflow and RPA +- **SAP Build Work Zone**: Business sites + +## Administrative Tools + +### SAP BTP Cockpit + +**Purpose**: Web-based platform administration + +**Capabilities:** +- Application management +- Resource configuration +- Security monitoring +- Cloud application operations +- Entitlement management + +### Landscape Portal + +**Purpose**: Partner and SaaS management (ABAP) + +**Capabilities:** +- System management +- Tenant management +- Product lifecycle +- Deployment pipelines + +## Command-Line Tools + +### Cloud Foundry CLI + +**Purpose**: Deploy and manage CF applications + +**Installation:** +```bash +# macOS +brew install cloudfoundry/tap/cf-cli + +# Windows +choco install cloudfoundry-cli + +# Linux +wget -q -O - [https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key](https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key) | sudo apt-key add - +echo "deb [https://packages.cloudfoundry.org/debian](https://packages.cloudfoundry.org/debian) stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list +sudo apt update && sudo apt install cf-cli +``` + +**Common Commands:** +```bash +# Login +cf login -a [https://api.cf.eu10.hana.ondemand.com](https://api.cf.eu10.hana.ondemand.com) + +# Deploy +cf push my-app + +# View apps +cf apps + +# View services +cf services + +# Scale +cf scale my-app -i 3 + +# Logs +cf logs my-app --recent +``` + +### CDS CLI + +**Purpose**: CAP development commands + +**Installation:** +```bash +# Install latest version (recommended for new projects) +npm install -g @sap/cds-dk@latest + +# Or pin to specific version for reproducibility +npm install -g @sap/cds-dk@8.0.0 +``` + +> **Version Strategy**: Use `@latest` for development to get newest features. For CI/CD pipelines and team consistency, pin to a specific version in your project's `package.json` devDependencies. + +**Common Commands:** +```bash +cds init my-project # Create project +cds add hana # Add HANA support +cds add xsuaa # Add authentication +cds watch # Run with live reload +cds build # Build for deployment +cds deploy # Deploy to HANA +cds compile # Compile CDS models +``` + +### MTA Build Tool (mbt) + +**Purpose**: Build multitarget applications + +**Installation:** +```bash +npm install -g mbt +``` + +**Commands:** +```bash +mbt build # Build MTA archive +mbt build -t ./ # Build to current directory +``` + +### CF MTA Plugin + +**Purpose**: Deploy MTA archives + +**Installation:** +```bash +cf install-plugin multiapps +``` + +**Commands:** +```bash +cf deploy my-app.mtar # Deploy MTA +cf mtas # List deployed MTAs +cf undeploy my-app # Undeploy MTA +``` + +## Kubernetes Tools + +### kubectl + +**Purpose**: Kubernetes cluster management + +**Commands:** +```bash +kubectl get pods # List pods +kubectl logs my-pod # View logs +kubectl describe pod # Pod details +kubectl apply -f file.yaml # Apply configuration +``` + +### kubelogin + +**Purpose**: OIDC authentication for kubectl + +### Helm + +**Purpose**: Kubernetes package manager + +**Commands:** +```bash +helm install my-app ./chart # Install chart +helm upgrade my-app ./chart # Upgrade release +helm list # List releases +helm uninstall my-app # Uninstall +``` + +### Paketo (Pack) + +**Purpose**: Cloud Native Buildpacks for container images + +**Commands:** +```bash +pack build my-image --builder paketobuildpacks/builder:base +``` + +### Docker Desktop + +**Purpose**: Local container development + +## Infrastructure Tools + +### Terraform Provider for SAP BTP + +**Purpose**: Infrastructure as code for SAP BTP + +**Configuration:** +```hcl +terraform { + required_providers { + btp = { + source = "SAP/btp" + } + } +} + +provider "btp" { + globalaccount = var.globalaccount +} + +resource "btp_subaccount" "my_subaccount" { + name = "my-subaccount" + region = "eu10" + subdomain = "my-subdomain" +} +``` + +### Cloud Connector + +**Purpose**: Secure on-premise connectivity + +**Features:** +- Reverse proxy operation +- Access control +- High availability +- Audit logging + +## Development Libraries + +### SAP Cloud SDK + +**Purpose**: Abstraction layer for enterprise development + +**Languages**: Java, JavaScript/TypeScript + +**Features:** +- Logging +- Multitenancy +- Connectivity +- OData/OpenAPI clients + +**Installation (Node.js):** +```bash +npm install @sap-cloud-sdk/core +npm install @sap-cloud-sdk/odata-v2-generator +``` + +**Example:** +```javascript +const { BusinessPartner } = require('@sap/cloud-sdk-vdm-business-partner-service'); + +const partners = await BusinessPartner.requestBuilder() + .getAll() + .execute({ destinationName: 'S4HANA' }); +``` + +## SAP Fiori Tools + +### Capabilities + +| Tool | Purpose | +|------|---------| +| Application Wizard | Generate Fiori apps | +| Service Modeler | Design OData services | +| Page Editor | Configure Fiori Elements pages | +| Guided Development | Step-by-step development | +| XML Editor | Edit Fiori Elements views | + +### Installation (VS Code) + +Search for "SAP Fiori tools" in VS Code extensions. + +## Service-Specific Tools + +Available through SAP Discovery Center for individual services. + +## Source Documentation + +- Tools Available: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tools-available-for-sap-btp-multi-cloud-foundation-7f95cfa.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tools-available-for-sap-btp-multi-cloud-foundation-7f95cfa.md) +- SAP Discovery Center: [https://discovery-center.cloud.sap/](https://discovery-center.cloud.sap/) diff --git a/references/tutorials.md b/references/tutorials.md new file mode 100644 index 0000000..e9ff474 --- /dev/null +++ b/references/tutorials.md @@ -0,0 +1,257 @@ +# SAP BTP Tutorials Reference + +## Overview + +SAP BTP provides structured learning paths through missions and tutorials, covering CAP and ABAP Cloud development scenarios. + +## Account Options + +### Free Tier for SAP BTP + +**Best for**: Productive projects + +- 30+ free-tier services +- Upgrade capability to paid plans +- Available under BTPEA, CPEA, Pay-As-You-Go +- One free plan per runtime (CF/Kyma) + +### SAP BTP Trial + +**Best for**: Learning and experimentation + +- 90-day trial period +- 30+ trial services +- Instant access +- Learning materials included + +## CAP Learning Path + +### Mission 1: Full-Stack CAP Application (Starter) + +**Sample Application**: Incident Management + +**Modules:** + +| Module | Topics | +|--------|--------| +| Core Development | Environment setup, CAP basics, Fiori Elements UI, custom logic, local launchpad, authorization, testing | +| Cloud Foundry Deployment | CF deployment, SAP Build Work Zone, CI/CD | +| Kyma Deployment | Kyma deployment, Work Zone, CI/CD | + +**Discovery Center**: Mission 4033/4432 + +### Mission 2: Side-by-Side Extension + +**Sample Application**: Incident Management + S/4HANA + +**Tracks:** + +| Track | Runtime | Backend | +|-------|---------|---------| +| Remote Service - CF | Cloud Foundry | Mock Server | +| Remote Service - CF | Cloud Foundry | S/4HANA Cloud | +| Remote Service - Kyma | Kyma | Mock Server | +| Remote Service - Kyma | Kyma | S/4HANA Cloud | +| Eventing - CF | Cloud Foundry | Mock/S/4HANA | +| Eventing - Kyma | Kyma | Mock/S/4HANA | + +**Prerequisites**: Complete remote service before eventing + +**Discovery Center**: Mission 3999 + +### Mission 3: Enterprise-Grade CAP Application + +**Features:** +- Change tracking +- Audit logging +- Attachment uploads + +**Sample Application**: Incident Management (enhanced) + +**Discovery Center**: Mission 4364 + +### Mission 4: Multitenant CAP Application + +**Sample Application**: Incident Management (SaaS) + +**Entry Point Options:** + +| Approach | Consumer Requirements | Site Management | +|----------|----------------------|-----------------| +| Central | SAP Build Work Zone instance | Consumer managed | +| Local | None | Provider managed | + +**Key Features:** +- Tenant isolation +- Subscription lifecycle +- Key user extensibility + +**Discovery Center**: Mission 4497 + +### Mission 5: Observability in CAP Application + +**Tool**: SAP Cloud Logging + +**Capabilities:** +- Logs +- Metrics +- Traces + +**Discovery Center**: Mission 4432/4718 + +## ABAP Learning Path + +### RAP100 Basics (Transactional) + +**Sample Application**: Flight Reference Scenario + +**Tutorials:** + +| Tutorial | Topics | +|----------|--------| +| Understanding RAP | Fundamentals, architecture | +| Database Tables | Table creation, data elements | +| UI Service Generation | Automatic CDS/RAP generation | +| Data Model Enhancement | Associations, annotations | +| OData Streams | Large object handling | +| Business Object Behavior | Numbering, determinations, validations | +| Fiori App Deployment | UI deployment, testing | +| Fiori Launchpad | Integration, tiles | + +### RAP100 Intermediate + +**Tutorials:** + +| Tutorial | Topics | +|----------|--------| +| Instance Actions | Custom actions on entities | +| Factory Actions | Create with copy | +| Dynamic Feature Control | Conditional UI elements | +| ABAP Unit Testing | Test class creation | + +### RAP120 (AI-Assisted) + +**Tool**: SAP Joule + +**Capabilities:** +- Predictive code completion +- ABAP Cloud Generator +- Unit test generation + +**GitHub**: RAP120 sample project + +### Analytical Scenario + +**Tutorials:** + +| Level | Tutorial | +|-------|----------| +| Beginner | Develop and Consume Queries on SAP Analytics Cloud | +| Intermediate | Queries Based on Booking Supplement | + +**Integration**: SAP Analytics Cloud with InA-enabled CDS + +### Certifications + +| Certification | Focus | +|---------------|-------| +| SAP Certified Associate - Back-End Developer - ABAP Cloud | RAP, CDS, ABAP Cloud | + +## Partner Tutorials + +### Poetry Slam Manager (CAP) + +**Type**: Reference application for multitenant CAP SaaS + +**GitHub**: [https://github.com/SAP-samples/partner-reference-application/](https://github.com/SAP-samples/partner-reference-application/) + +**Tutorial Coverage:** +1. Core application development (business models, logic) +2. Enhancement to multitenant (multi-customer) solutions +3. ERP backend integration (S/4HANA Cloud, Business One, Business ByDesign) +4. Feature expansion +5. Application extension + +**Key Topics:** +- Full-stack CAP development +- ERP-agnostic design +- Cost optimization +- Subscription lifecycle + +**Bill of Materials**: [https://github.com/SAP-samples/partner-reference-application/blob/main/Tutorials/01-BillOfMaterials.md](https://github.com/SAP-samples/partner-reference-application/blob/main/Tutorials/01-BillOfMaterials.md) + +### Music Festival Manager (ABAP) + +**Type**: Reference application for multitenant ABAP SaaS + +**GitHub**: Partner Reference Application on GitHub + +**Tutorial Coverage:** +1. **Core Application Development**: Business models, logic, UI, authentication, role-based authorization +2. **Deployment & Provisioning**: Building and deploying to consumers +3. **SAP S/4HANA Cloud Integration**: Connecting with enterprise systems +4. **Feature Enhancement**: Expanding application capabilities + +**Key Topics:** +- Full-stack ABAP Cloud development using RAP +- Scalable multitenant architecture +- SAP BTP Developer's Guide best practices + +### Partner Reference Application Extension + +**Type**: Customer-specific extension example + +**GitHub**: [https://github.com/SAP-samples/partner-reference-application-extension](https://github.com/SAP-samples/partner-reference-application-extension) + +**Topics:** +- Enhanced catering management capabilities +- Tenant-specific configurations +- Key user extensibility +- Base application integration + +## Learning Resources + +### SAP Learning Journeys + +| Journey | Focus | +|---------|-------| +| Practicing Clean Core Extensibility for SAP S/4HANA Cloud | Extensions | +| Acquiring Core ABAP Skills | ABAP fundamentals | + +### Additional Resources + +| Resource | URL | +|----------|-----| +| SAP Developers | [https://developers.sap.com/](https://developers.sap.com/) | +| SAP Learning | [https://learning.sap.com/](https://learning.sap.com/) | +| SAP Community | [https://community.sap.com/](https://community.sap.com/) | +| SAP Discovery Center | [https://discovery-center.cloud.sap/](https://discovery-center.cloud.sap/) | + +## Prerequisites Management + +### Entitlements + +Before starting missions: +1. Open BTP Cockpit +2. Navigate to Entitlements +3. Configure quotas for services +4. Assign to subaccount + +### Common Services Required + +| Service | Plan | Purpose | +|---------|------|---------| +| SAP HANA Cloud | hana | Database | +| Cloud Foundry Runtime | MEMORY | Application runtime | +| SAP Build Work Zone | standard | Launchpad | +| Continuous Integration & Delivery | default | CI/CD | + +## Source Documentation + +- CAP Tutorials: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tutorials-for-sap-cloud-application-programming-model-eb7420a.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tutorials-for-sap-cloud-application-programming-model-eb7420a.md) +- ABAP Tutorials: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tutorials-for-abap-cloud-fd87aaa.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/tutorials-for-abap-cloud-fd87aaa.md) +- Starter Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/starter-mission-develop-a-full-stack-cap-application-ebd19b5.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/starter-mission-develop-a-full-stack-cap-application-ebd19b5.md) +- Extension Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-a-side-by-side-cap-based-extension-application-2289e25.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-a-side-by-side-cap-based-extension-application-2289e25.md) +- Multitenant Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-a-multitenant-cap-application-6d2cbe9.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-a-multitenant-cap-application-6d2cbe9.md) +- Enterprise Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-an-enterprise-grade-cap-application-b5be786.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-develop-an-enterprise-grade-cap-application-b5be786.md) +- Observability Mission: [https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-implement-observability-in-a-full-stack-cap-application-c5636db.md](https://github.com/SAP-docs/btp-developer-guide/blob/main/docs/mission-implement-observability-in-a-full-stack-cap-application-c5636db.md) diff --git a/references/ux-design.md b/references/ux-design.md new file mode 100644 index 0000000..9c154ba --- /dev/null +++ b/references/ux-design.md @@ -0,0 +1,270 @@ +# SAP BTP UX Design Reference + +## Overview + +SAP BTP applications require consistent, compliant user experiences using the SAP Fiori design language. Three main approaches are recommended for UI development. + +## User Experience Dimensions + +### Five Usability Factors + +| Factor | Description | +|--------|-------------| +| Effectiveness | Accomplishing intended tasks | +| Efficiency | Minimizing effort required | +| Ease of learning | Intuitiveness for new users | +| Error tolerance | Handling mistakes gracefully | +| Satisfaction | Positive user perception | + +### Consistency + +Consistency contributes to ease of learning and efficiency. Follow SAP Fiori Design Guidelines to maintain alignment with standard SAP applications. + +## UI Development Approaches + +### 1. SAP Fiori Elements + +**Description**: Framework on top of SAPUI5 with predefined templates based on OData services + +**Best For**: Standard business applications + +#### Floorplans + +| Floorplan | Use Case | +|-----------|----------| +| List Report | Data browsing with filters | +| Object Page | Detail view with sections | +| Overview Page | KPIs and quick actions | +| Worklist | Task-oriented lists | +| Analytical List Page | Analytics with filters | + +#### Building Blocks + +Reusable UI components: +- Data visualization +- Form entry +- Value helps +- Tables +- Charts + +#### Benefits +- Rapid development +- Consistent UX +- Automatic compliance +- Responsive design + +### 2. Flexible Programming Model + +**Description**: Extend SAP Fiori Elements with custom logic + +**Best For**: Applications needing selective customization + +#### Extension Points +- Custom columns +- Custom actions +- Custom sections +- Custom fragments + +#### Custom Pages +Leverage Fiori Elements base with: +- Building blocks +- Routing +- State management + +### 3. Freestyle SAPUI5 + +**Description**: Full UI control using SAPUI5 framework + +**Best For**: Highly customized interfaces + +**Considerations**: +- Greater development effort +- Manual compliance implementation +- Full flexibility + +## SAP Fiori Tools + +| Tool | Purpose | +|------|---------| +| Application Wizard | Generate Fiori apps from templates | +| Service Modeler | Design OData services visually | +| Page Editor | Configure Fiori Elements pages | +| XML Editor | Edit view definitions | +| Guided Development | Step-by-step feature addition | + +## Compliance Standards + +### Automatic Inheritance + +> **Note**: Automatic compliance applies specifically when using **SAP Fiori Elements** with recommended patterns, **OData V4** services with proper annotations, and **internationalization (i18n)** setup. Custom or Freestyle SAPUI5 applications require manual compliance verification. + +**Prerequisites for automatic compliance:** +1. Use SAP Fiori Elements floorplans +2. Expose OData V4 services with proper UI annotations +3. Enable internationalization (i18n) for all user-facing text +4. Follow SAP Fiori design guidelines for customizations + +| Standard | Coverage | Requirement | +|----------|----------|-------------| +| Accessibility (WCAG 2.2) | Automatic | Fiori Elements + proper labels | +| SAP Fiori Design Guidelines | Automatic | Standard floorplans | +| Responsive Design | Automatic | Fiori Elements controls | +| Performance Optimization | Automatic | OData V4 batching | +| Security Protections | Automatic | XSUAA + CSRF tokens | + +### Accessibility Requirements + +```xml + +