Prepare environment - SAP CAP Guide 1

Hello and welcome to this tutorial series where we will create a basic CDS service based on the SAP provided examples.

Preparation

  • Download and install Visual Studio Code on your local machine
  • Setup a Trial account on SAP Cloud Platform - GUIDE
  • Install Cloud Foundry CLI on your machine - LINK
  • Install NodeJS - LINK

Create new Space

After you have logged into the cloud platform cockpit you have to select your sub account. In my case, a trial account, it is called trial. If you are on a corporate account, feel free to create a new one for your adventures. Keep in mind that it needs to be a Cloud Foundry sub account, not a NEO. Select the sub account and create a new space. Name the space whatever you like, I will call mine racoon as the name of a project I am working on.

Login at the cli

Now we are switching to our terminal to set up our development environment. Use the following command to login. You can get the API-URL from the dashboard of your sub account as seen in above picture. The USERNAME is actually your email address, which you used to register your trial account. If you do not remember you can click on your Name in the upper left corner and select User Information. For ORG use the name of your sub account and for SPACE the name you specified for your new space, the step before:

cf login -a API-URL -u USERNAME -p PASSWORD -o ORG -s SPACE

Here is an example of how it might look like:

cf login -a https://api.cf.eu10.hana.ondemand.com -u [email protected] -p PASSWORD -o trial -s racoon

Setup the development environment

Now we are nearly ready to get started, but we still have a few steps to go, before beginning. Go to the SAP Development Tools page and download the CDS Language Support for Visual Studio Code. After that you can double click and install it.

Configure NPM

The last step before finally creating our project is to setup npm to work with SAP repositories and install the cds package. First step is to add the npm registry:

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

Then we can install cds support:

npm i -g @sap/cds

Now we are ready to create our first project, Let’s get started in the next article! Click here to get to the next guide.

comments powered by Disqus