268 lines
6.7 KiB
Markdown
268 lines
6.7 KiB
Markdown
# 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)
|