S4 Extension with CAP
Scenario
This sample applications shows how to extend an existing oData service on BTP using CAP.
In our scenario, we want to extend the entity A_BusinessPartner of an external service (BusinessPartner API) with a note field so that our end-users of the applictions can maintain notes for each business partner
Diagramm
Usage
Business Partner Local Mock
Start a CAP process for the local mock server for Business Partner and a second one for the CustomerService:
- Run:
cds mock API_BUSINESS_PARTNER -p 5001 - Wait until startup is completed
- Run in a 2nd terminal:
cds serve all --with-mocks --in-memory - Now, you can issues the requests listed in
requests.http
Business Partner from Sandbox Server
- Goto https://api.sap.com/api/API_BUSINESS_PARTNER/resource
- Get service key
- Export env var
S4_APIKEYwith the service key (export S4_APIKEY="<your-service-key>") - Run:
CDS_ENV=sandbox cds watch - Now, you can issues the requests listed in
requests.http
