Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 


A lot has already been said about the Cloud Application Programming Model(CAP) for SAP Cloud Platform.CAP provides an easy way to build Business Applications on SAP Cloud Platform within an SAP ecosystem. The following links provides more information on CAP and how it benefits for Developers developing applications on SAP Cloud Platform.

This blog is going to describe the way how the CAP can be leveraged in creating an API-as-a Service Scenario. Consequently we are also going to see how this API can be managed using SAP API Management .



Org_X is into Health Business and is trying to leverage the data already captured in its Back-end systems. Therefore it decides to expose these data to the developers , so that the data becomes valuable to them. The exposing of the data would be in the form of HTTP APIs for the scenario Nutrient-As-A-Service. These APIs would become the building blocks for its business. The APIs would attract Developers and once the Developer finds value in the APIs , Org_X expects to monetise these APIs as well.

In order to achieve this goal, Org_X decides to create Application on SAP Cloud Platform using Cloud Application Programming Model. For Managing, Metering, Monetising and Developer Onboarding Org_X decides to use SAP API Management- which lets API Provider and API Consumer come under the same platform and engage.


Develop Nutrient-As-a-Service using Cloud Application Programming Model(CAP)

As pre-requisite follow this blog to install Cloud Foundry Builder

  1. In SAP Web IDE choose File | New | Project from Template.

  2. Select Business Application as the Template

  3. Provide the Application Details

  4. Define the Data Model indb/data-model.cds
    namespace nutrientservice;

    entity nutrientinfo {
    key id:Integer not null;

  5. Define the Service- Go to srv/my-service.cds and open the context menu.
    using nutrientservice.nutrientinfo as nutrientserv from '../db/data-model';
    service NutrientService{
    entity nutrientinfo as projection on nutrientserv;

  6. Save the Project and Run the Service

  7. Once the Service is run , use the Cloud Foundry option to Deploy the application to Cloud Foundry.

  8. The Application is Now deployed in Cloud Foundry and the API is ready to be Governed, metered and Monitored.


Check out the following blog on how to Govern, Meter and Monetise this API using SAP API Management.