https://github.com/gregorwolf/cap-replication-demo
Demonstrate replication with CAP
https://github.com/gregorwolf/cap-replication-demo
Last synced: 9 months ago
JSON representation
Demonstrate replication with CAP
- Host: GitHub
- URL: https://github.com/gregorwolf/cap-replication-demo
- Owner: gregorwolf
- Created: 2022-06-17T05:22:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-16T16:16:27.000Z (about 1 year ago)
- Last Synced: 2025-06-16T12:53:05.009Z (12 months ago)
- Language: JavaScript
- Size: 439 KB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demonstrate replication with CAP
## Setup
```
npm ci
```
## Start the application
Create a file `default-env.json` and add the following content and
```JSON
{
"destinations": [
{
"name": "S4HANA_DEV",
"url": "http://localhost:4005"
},
{
"name": "S4HANA",
"url": "http://localhost:4005"
}
]
}
```
First start the mock service for the Business Partner API:
```bash
cds mock API_BUSINESS_PARTNER --port 4005
```
Then start the CAP application:
```bash
cds w
```
## Test the application
Use [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) to run the requests in the `test` folder. Start with bp-mock.http to check what data the mock service returns.
Now you can test further with the requests in replication.http.
When you have replicated the data from the source systems to the local database you can then run the upsert.http requests to merge the entries of the entity A_CustomerSalesAreaText from the source systems with the target system.
## With Data from the api.sap.com Sandbox
Create a `.cdsrc-private.json` file with the following content:
```JSON
{
"requires": {
"[hybrid]": {
"API_BUSINESS_PARTNER": {
"credentials": {
"headers": {
"APIKey": ""
}
}
}
}
}
}
```
then run:
```
cds watch --profile hybrid
```
## In hybrid mode with a real S/4HANA System
Create a file `default-env.json` and add the following content and
```JSON
{
"destinations": [
{
"name": "S4HANA",
"url": "",
"username": "",
"password": ""
}
]
}
```