Type a new space name, select Full Stack Cloud Application, check CDS Graphical Modeler, SAP HANA Calculation View Editor, SAP HANA Database Explorer and SAP HANA Tools.
Select menu Create project from template on Welcome page.
Select CAP tile and then Next. Type your project name, and then select features hana, mta and samples.
"@sap/hana-client": "^2.6.61"
"start": "cds run",
"hana": "cds deploy --to hana:mycapdemo-db --auto-undeploy",
"build": "cds build/all --clean"
"hana": {
"deploy-format": "hdbtable"
}
"kind": "hana"
NOTES: Keep the segment "name": "mycapdemo" and hana instance name "mycapdemo-db" mapping. It will avoid much manual job in subsequent steps.
{
"name": "mycapdemo",
"version": "1.0.0",
"description": "A simple CAP project.",
"repository": "<Add your repository here>",
"license": "UNLICENSED",
"private": true,
"dependencies": {
"@sap/cds": "^5",
"express": "^4",
"@sap/hana-client": "^2.6.61"
},
"devDependencies": {
"@sap/hdi-deploy": "^4.2.0",
"sqlite3": "^5.0.2"
},
"scripts": {
"start": "cds run",
"hana": "cds deploy --to hana:mycapdemo-db --auto-undeploy",
"build": "cds build/all --clean"
},
"cds": {
"hana": {
"deploy-format": "hdbtable"
},
"requires": {
"db": {
"kind": "hana"
}
}
}
}
namespace my.bookshop;
entity Books {
key ID : Integer;
title : String;
stock : Integer;
author : Association to Authors;
}
entity Authors {
key ID : Integer;
name : String;
Address : String;
books : Association to many Books on books.author = $self;
}
Note: Create the CSV file manually if related file not existing
npm install
npm run hana
npm start
After command line execute finished. Click "Open in new tab" to test my cds.services. If you can see following page, that means your cds.service works fine.
Open menu View -> Find Command, search item "artifact" in search box.
Open wizard Create SAP HANA Database Artifact
Select Calculation View in Artifact Type drop-down list, and then type a new artifact name
Click new created file event_calc_view.hdbcalculationview to open calculation view editor.
Click "Create Join" from left frame, and then add Data Source "MY_BOOKSHOP_AUTHORS" and "MY_BOOKSHOP_BOOKS"
Double click the join node, and then open the join_1 settings. Drag and drop the ID to BOOKs.AUTHOR_ID
Click Mapping tab in the join_1 setting, drag and drop the column from left Data Source to right Output Columns, and then drag the arrow connect to Aggregation node, click "X" to close the join_1 settings page
Click "Create Rank" to add a new rank node to Calculation View
Double click on the Rank_1 node to open rank settings, switch to Mapping tab. Make sure all related columns list out in the left Data Sources list
Switch to Definition tab, add new sort ID in Sort Column.
Click Aggregation node to navigate to aggregation settings, drag and drop all columns to the Output Columns list
Click the Rocket icon to deploy your calculation view to SAP HANA Cloud
Note: Make sure your dev space has already connected to CF correctly. If not, you can run command cf login
to login CF
Click cubic icon under the DB Connection node to open the HDI container in SAP HANA Database Explorer. Please bind HDI container manually if your DB connection is empty
Click Column Views under HDI container "mycapdemo-db". Select the calculation view, and then click Open Data
Drag and drop measures to Value Axis, check the preview. If preview displays correctly, which means the calculation view deployed successfully.
Required Parameters |
---|
host |
user |
password |
Login SAC, create new connection to connecting SAP HANA Cloud, input the parameters into the connection wizard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
36 | |
25 | |
16 | |
13 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 |