SAP Cloud Platform Backend service: Tutorial [0.3]: CDS model creation tools
For those of you following the SAP Cloud Platform Backend service tutorial series:
Please find here the tooling required to
model the CDS model…. ehm, to model the CDS design…., sorry, I mean:
the tooling required to design the CDS model.
You can use the WebIDE or Visual Studio Code
APPENDIX 1: create CDS model using WebIDE
The advantage of using WebIDE: the tool is in the cloud, a cloud similar to the cloud where the Backend service can be found.
Go to your trial account: https://account.hanatrial.ondemand.com
In the welcome screen, click on Neo Trial
Click on “Services” in the left navigation pane
Search for “SAP Web IDE Full-Stack” (you can use the filter field in the upper right corner)
Click on the Web IDE service tile.
If it is not yet enabled, (like in my screenshot) then just click on the “enable” button
After a short while, the service gets enabled and you can click on “Go to Service” on the bottom of the screen.
Guess what? The popular Web IDE is opened.
You may wish to bookmark the URL, it looks similar like this:
Click on the “Development” icon on the left pane, to go from the welcome screen to the development tool
Now you need to first create a folder.
You can use right mouse click on the workspace node, then New -> Folder
Enter a folder name of your choice
Then create a file inside the folder.
Give it a name of your choice with file extension .cds
The file is opened in the CDS editor.
The advantage of this editor is syntax highlighting and validation
Below example shows the validation marker and the highlighting:
After you’re done with modelling, you can export the file to your local file system.
BTW, WebIDE can be connected to Github, which allows you to share your design artifacts
APPENDIX 2: create CDS model using Visual Studio Code
If you’re a friend of coffee, kitten and local development, you might wish to use your Visual Studio Code for creating and editing CDS files.
This wish has come to reality by means of the CDS plugin for VS Code
To install Visual Studio Code, go to the homepage at https://code.visualstudio.com/
To install the CDS plugin, go to the SAP Development Tools site: https://tools.hana.ondemand.com/#hanatools
Scroll down to the chapter “CDS Language Support for Visual Studio Code”
Click on the link to download the vscode-cds-xxx-.vsix file to your local file system
Most probably you’re familiar with installing extensions into VS Code
If you’re doing these steps for the first time, you may read on:
Open VS Code
Click on View -> Extensions from the main menu (alternatively, click on the “Extensions” icon on the left pane)
The “Extensions” view is opened. It allows to browse public extensions.
However, in order to add the downloaded extension file, click on the 3 dots, then “Install from VSIX”
Navigate to your downloaded vscode-cds-xxx-.vsix file, then select and confirm
The extension is installed.
After installation, VS Code needs to be reloaded
Afterwards, you can see the enabled extension:
Now it is your turn: create many many .cds files and enjoy the advanced features, e.g. the intelligent highlighting of occurrences (wow…even the $self reference is detected):
APPENDIX 3: create CDS model using Eclipse
This is in planning…