Service layer is created under srv folder. Right click on the srv folder on the left pane and select the option New File to create a new file called project. Hence our next step is to define a service layer.ġ4. This means that the loaded models which are the CDS entities do not have a service layer defined with which they can connect to. After typing the cds watch command having defined the cds entities, the message appears as shown in the screen below, saying No service definitions found in loaded models. A popup appears with the message “ A service is listening to port 4004” with the button Open in New Tab. In terminal window enter the command cds watch and hit enter key.
The code appears as shown in the below screen after selecting the option Format document.ġ2. To arrange code in a legible manner, right click on the white space and select the option “Format document”. Here I’ve used the field id as my key field.Ĭode for the CDS entities I created in this blogĭate_of_Sale : Date - Date should be entered in the format YYYY-MM-DDĭate_of_Purchase : Date - Date should be entered in the format YYYY-MM-DD Key id : Integer - One of the fields in the entity has to be defined as a Key. Following is the syntax to create a CDS entity. In this example I’ve created two CDS entities Sales and Purchases. In schema.cds window you create and define the actual CDS entities. The file schema.cds is created by right clicking on db folder and selecting the option New File. Now on the left pane under Explorer menu, right click on the db folder and select the option New File to create a new file named schema.
Let us now see how to create a CDS entity. Now the command prompt in the terminal changes to test1 $ as shown in the screen below.ġ0. You do this every time you want to launch a terminal in SAP Business Application Studio.ĩ. Again go to Terminal menu and select the option New Terminal. The below screen shows that you are in the workspace for the application Test1.Ĩ.
You see that the application test1 that you created in step 4 above appears here. Go to File menu and select the option Open Workspace.Ħ. The command to create a application is cds init test1. Type the command cd projects to go to projects $ prompt.Ĥ. You see a User $ prompt appears in the bottom section of the screen as shown below.ģ. Go to Terminal menu and select the option New TerminalĢ.In SAP HANA a CDS entity is a table that is organized into columns and rows with predefined data types for each column.įirst step is to create a new application in a Workspace. In this blog I’ll show you how to create CDS entities in SAP Business Application Studio. This blog is continuation of my previous blog wherein I showed how to launch SAP Business Application Studio from SAP HANA Cloud and how to create a dev space to work in SAP Business Application Studio.