Posted on

#2 Installation of SAP® CAPM – 7 Steps to Get Started With SAP® CAPM

Before we begin!

In this 7 blog series, we are going to provide a small end-to-end scenario to work with SAP® CAPM. Here the usecase we are going to use is of Learning Management System(LMS) and build a Student List App and Deploy it to SCF.

Link to Master(or Main) Blog from which all the other blogs can be reached is Here.

  • If you wanted to check out the detailed course on SAP® CAPM the link is Here.
  • If you want to get learn SAP® Cloud Platform Development in Detailed then we have a 35hrs hands-on course Here.
  • For current offers and discounts check offer page Here.

In this section we are going to install SAP® CAPM library in our local computer

 

Prerequisite:

You need to have NodeJS installed(official NodeJS site here and all versions for download from here) in your machine(v10.5 is what we have used).

Also, NPM(Node Package Manager) would automatically get installed with NodeJS.

 

Step 1: Set NPM registry of SAP®

NPM registry points to a place where libraries are present. When NPM installs a package, then it looks to that place to find the library.

Example: Suppose, you have a registry at www.mycoolrepo.com where you are having your xyz library(or module).
When you use npm install xyz it should search your www.mycoolrepo.com for the xyz module, then download that to the current project where you are working.

In the case of CAPM and related development, we are going to use https://npm.sap.com NPM registry to install required Node Modules. Use below command to set this:

    npm set @sap:registry=https://npm.sap.com

Step 2: Confirm installation

We will list all the NPM repository present in our computer

 npm config list

On successful Installation we will see npm.sap.com as registry:

Output

Step 3: Install @sap/cds

@sap/cds will provide us cds command access in terminal/command prompt.
Using cds we will be able to:

  • Create
  • Run
  • Build

CAPM Code Locally.

We can -g flag with the command to install @sap/cds-dk globally, use command below to install the cds-dk library globally:

    npm install -g @sap/cds-dk

Step 4: Confirm installation

To confirm installation of @sap/cds use command

  cds

You will get the output as shown below

USAGE
    cds <command> [<args>]
    cds <src>  =  cds compile <src>
    cds        =  cds help
COMMANDS
    i | init       jump-start cds-based projects
    c | compile    process models selectively
    m | import     add models from external sources
    s | serve      run servers locally
    r | repl       read-eval-event loop
    e | env        get/set cds configuration
    b | build      prepare for deployment
    d | deploy     e.g. to databases or cloud
    v | version    get detailed version information
    ? | help       get detailed usage information
    Learn more about each with:
    cds help <command> or
    cds <command> ?

Step 5: Search modules inside registry

You can search inside https://npm.sap.com registry to see all
packages it contains with command:

 npm search --registry https://npm.sap.com sap

Output:

    NAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS
@sap/approuter            | Node.js based…       |                 | 2019-11-12 | 6.6.0    |         
@sap/site-entry           | SAP Portal…          | =Portal Team    | 2019-08-07 | 1.30.0   | 
@sap/grunt-sapui5-bestpra | Grunt tasks around…  |                 | 2019-10-03 | 1.4.2    | 
ctice-build               |                      |                 |            |          | 
@sap/xsjs                 | Compatibility layer… |                 | 2019-11-20 | 5.3.0    | 
@sap/xssec                | XS Advanced…         |                 | 2019-09-02 | 2.2.3    | xs
@sap/cds                  | Entry Point and API… |                 | 2019-11-18 | 3.18.4   | 
@sap/node-jwt             | JWT validation…      |                 | 2019-09-27 | 1.6.5    | jwt security sap xs
@sap/xsodata              | Expose data from a…  |                 | 2019-10-28 | 4.7.0    | odata xsjs
@sap/hdbext               | Hana-client…         |                 | 2019-11-20 | 6.1.1    | HDB hana sap sql hdi
@sap/portal-cf-content-de | SAP portal site…     | =Portal Team    | 2019-11-20 | 3.24.0-… | portal content-deployer
ployer                    |                      |                 |            |          |                        
@sap/cloud-sdk-core       | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
@sap/cloud-sdk-test-util  | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
@sap/cloud-sdk-vdm-accoun | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
ting-document-service     |                      |                 |            |          | 
@sap/cloud-sdk-vdm-attach | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
ment-service              |                      |                 |            |          | 
@sap/cloud-sdk-vdm-bank-d | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
etail-service             |                      |                 |            |          | 
@sap/cloud-sdk-vdm-batch- | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
service                   |                      |                 |            |          | 
@sap/cloud-sdk-vdm-bill-o | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
f-material-comparison-ser |                      |                 |            |          | 
vice                      |                      |                 |            |          | 
@sap/cloud-sdk-vdm-bill-o | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
f-material-service        |                      |                 |            |          | 
@sap/cloud-sdk-vdm-bill-o | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
f-material-v2-service     |                      |                 |            |          | 
@sap/cloud-sdk-vdm-bill-o | SAP Cloud SDK for…   |                 | 2019-11-21 | 1.13.1   | 
f-material-where-used-ser |                      |                 |            |          | 
vice                      |                      |                 |            |          |

Before we end!

In this 7 blog series, we are going to provide a small end-to-end scenario to work with SAP® CAPM. Here the usecase we are going to use is of Learning Management System(LMS).

Link to Master(or Main) Blog from which all the other blogs can be reached is Here.

  • If you wanted to check out the detailed course on SAP® CAPM the link is Here.
  • If you want to get learn SAP® Cloud Platform Development in Detailed then we have a 35hrs hands-on course Here.
  • For current offers and discounts check offer page Here.
Posted on

#1 Introduction – 7 Steps to Get Started With SAP® CAPM

Before we begin!

In this 7 blog series, we are going to provide a small end-to-end scenario to work with SAP® CAPM. Here the usecase we are going to use is of Learning Management System(LMS) and build a Student List App and Deploy it to SCF.

Link to Master(or Main) Blog from which all the other blogs can be reached is Here.

  • If you wanted to check out the detailed course on SAP® CAPM the link is Here.
  • If you want to get learn SAP® Cloud Platform Development in Detailed then we have a 35hrs hands-on course Here.
  • For current offers and discounts check offer page Here.

Now let’s start this series with a little background about SAP® CAPM

Table of Content

#1. Why and What
#2. Developer Stack
#3. Links to Blogs of this Series

 

 

 

#1: Why and What

SAP® Cloud Application Programming Model(CAPM) is a set of Library, Tools, Language and Framework from SAP® for building Apps.

The main reason for creating CAPM is to

  • Provide a Simple way to Create Cloud-Based Apps
  • The Apps and code which developer created can be made more reusable as modules
  • Advantage of Microservice can be utilized
  • Apps in Cloud can be easily integrated with Cloud Services(like DB service, message broker service or Auth Provider service)
  • A developer can focus more on the functional side of problem-solving

The 2 main Principle of SAP® CAPM are:

  • Declarative Approach: Focus on Outcome, not on Way!
  • Service-Based Approach: Get the Functionality from Service

Declarative Approach

So, if you are a developer you need to focus more on understanding the functional side which is what customer needs now, and also thinking about how can the App/Platform you are developing will evolve over time. Keeping this in mind you need to keep your current development modular, so it can allow future changes easily or your current development can be reused in the future easily.

Service-Based Approach

In CAPM all functionalities need to be broken down as service(s). In CAPM Services are stateless which means there is no record of previous interactions and each interaction request has to be handled based entirely on information that comes with it. You will also see, that to implement new service/functionality we will many times query existing service(s).

 

#2: Developer Stack

That Sounds Great! But you might be having questions like How it is Build and How as a developer you will work with it?

 

  • CAPM Lib are Predominantly Build With NodeJS, so you need to have basic know-how of NodeJS
  • We will use a lot of CDS code, may it be for building data structure(entity model/Table Structure), creating services(with functions) or even creating UI(with CDS Annotations)
  • You will find many out of the box tools which are part of CAPM, for example for running Apps with Fiori® Preview just with developed service, for building data structure to deploy in Database like HANA®, Sqlite or Other Other and many more surprises!

 

Prerequisite and Getting Started

We will create a simple End-to-End CAPM App using HDI Container in SAP® Cloud Foundry from Scratch.

Regarding Prerequisites:

  • Basic knowledge of NodeJS is required
  • Basic knowledge of SAPUI5 is required
  • Basic knowledge of CDS is required

#3: Links to Blogs of this Series

  • Introduction – this blog
  • Installation – here
  • Hello World Service – here
  • Creating Schema and Database – here
  • Create UI Annotations – here
  • Create UI5 App – here
  • Deploy App to SCF – here

Before we end!

Link to Master(or Main) Blog from which all the other blogs can be reached is Here.

 

  • If you wanted to check out the detailed course on SAP® CAPM the link is Here.
  • If you want to get learn SAP® Cloud Platform Development in Detailed then we have a 35hrs hands-on course Here.
  • For current offers and discounts check the offer page Here.

 

Also, You can Watch the Entire Blog Series in the below video:

 

 

 

 

 

Thanks for Your Time!