You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- This tutorial is designed for [SAP HANA Cloud](https://community.sap.com/topics/hana). It is not designed for SAP HANA on premise or SAP HANA, express edition.
13
14
- You have created a BTP, SAP HANA Cloud instance. [Deploy SAP HANA Cloud](hana-cloud-deploying)
14
15
- You have setup SAP Business Application Studio for development: [Set Up SAP Business Application Studio for Development](appstudio-onboarding)
15
16
16
17
## Details
18
+
17
19
### You will learn
20
+
18
21
- How to create an application with the wizard for the [SAP Cloud Application Programming model](https://cap.cloud.sap/docs/)
19
22
- How to use the local Git repository for development/testing purposes
20
23
@@ -28,40 +31,39 @@ Dev spaces are like isolated virtual machines in the cloud that can be quickly s
28
31
29
32
In this step we will create a new Dev Space configured for SAP Cloud Application Programming Model (CAP) development. If you already have a dev space configured for CAP and HANA development, you can skip this step as each dev space can hold multiple projects.
30
33
31
-
32
34
1. Go to your SAP Business Technology Platform subaccount and click the **Services -> Instances and Subscriptions** option.
33
35
34
36
!
35
37
36
-
3. Locate the **SAP Business Application Studio** entry and click **Go to Application**
38
+
1. Locate the **SAP Business Application Studio** entry and click **Go to Application**
37
39
38
40
!
39
41
40
-
4. Choose **Create Dev Space**. Please NOTE: In the SAP BTP trial and free tier you are limited to only two Dev Spaces and only one can be active at a time. If you have performed other tutorials, you might already have reached your maximum. In that case you might have to delete one of the other dev spaces in order to continue with this tutorial.
42
+
1. Choose **Create Dev Space**. Please NOTE: In the SAP BTP trial and free tier you are limited to only two Dev Spaces and only one can be active at a time. If you have performed other tutorials, you might already have reached your maximum. In that case you might have to delete one of the other dev spaces in order to continue with this tutorial.
41
43
42
44
!
43
45
44
-
3. Enter any name you wish for your dev space name and choose **Full Stack Cloud Application** as the kind of application you are creating.
46
+
1. Enter any name you wish for your dev space name and choose **Full Stack Cloud Application** as the kind of application you are creating.
45
47
46
48
!
47
49
48
-
4. The Dev space will automatically be configured with the most common tools you need for the type of application you choose. However you can also choose additional, optional extensions. Since you want to combine CAP and HANA artefacts in the same project, we would ask that you also choose SAP HANA Calculation View Editor and SAP HANA Tools at minimum.
50
+
1. The Dev space will automatically be configured with the most common tools you need for the type of application you choose. However you can also choose additional, optional extensions. Since you want to combine CAP and HANA artefacts in the same project, we would ask that you also choose SAP HANA Calculation View Editor and SAP HANA Tools at minimum.
49
51
50
52
!
51
53
52
-
5. Once all selections are completed, press **Create Dev Space**
54
+
1. Once all selections are completed, press **Create Dev Space**
53
55
54
56
!
55
57
56
-
6. The Dev Space will then begin starting and the process will take a minute or so as your cloud environment is being created
58
+
1. The Dev Space will then begin starting and the process will take a minute or so as your cloud environment is being created
57
59
58
60
!
59
61
60
-
7. Once the Dev Space reaches the green status of **RUNNING**, you can click on the name of the Dev Space and it will load into the editor within your browser
62
+
1. Once the Dev Space reaches the green status of **RUNNING**, you can click on the name of the Dev Space and it will load into the editor within your browser
61
63
62
64
!
63
65
64
-
8. You'll be redirected to your newly created SAP Business Application Studio Dev Space. We recommend you bookmark this URL so it's easier for you to access this dev space of your SAP Business Application Studio in the future
66
+
1. You'll be redirected to your newly created SAP Business Application Studio Dev Space. We recommend you bookmark this URL so it's easier for you to access this dev space of your SAP Business Application Studio in the future
65
67
66
68
!
67
69
@@ -76,71 +78,69 @@ Before we create our SAP HANA project, we want to do a few more one-time configu
76
78
77
79
!
78
80
79
-
2. Now in the Cloud Foundry Targets window you can expand either Service or Applications and then click on the Logon icon to continue the configuration process
81
+
1. Now in the Cloud Foundry Targets window you can expand either Service or Applications and then click on the Logon icon to continue the configuration process
80
82
81
83
!
82
84
83
-
3. The command window will then open at the top of the SAP Business Application Studio. The first input will prompt you for the API endpoint
85
+
1. The command window will then open at the top of the SAP Business Application Studio. The first input will prompt you for the API endpoint
84
86
85
87
!
86
88
87
-
4. The default value proposed is likely the correct value, but if you need to confirm; the value can be found in the SAP BTP cockpit at the Subaccount level
89
+
1. The default value proposed is likely the correct value, but if you need to confirm; the value can be found in the SAP BTP cockpit at the Subaccount level
88
90
89
91
!
90
92
91
-
5. Press **Enter** to confirm your input of the API endpoint. The next input field will ask you for the email address you used to create your SAP BTP trial account
93
+
1. Press **Enter** to confirm your input of the API endpoint. The next input field will ask you for the email address you used to create your SAP BTP trial account
92
94
93
95
!
94
96
95
-
6. The next input will ask you for your SAP BTP trial account password
97
+
1. The next input will ask you for your SAP BTP trial account password
96
98
97
99
!
98
100
99
-
7. The next input will ask you for your Organization. In most situations you will have a single choice. But like the API endpoint earlier, if you need to confirm the correct value it will be displayed in the top navigation of the SAP BTP cockpit
101
+
1. The next input will ask you for your Organization. In most situations you will have a single choice. But like the API endpoint earlier, if you need to confirm the correct value it will be displayed in the top navigation of the SAP BTP cockpit
100
102
101
103
!
102
104
103
-
8. The final input will ask you for your Space. If you choose the endpoint API and Organization correctly, then you should have a single option of **dev**
105
+
1. The final input will ask you for your Space. If you choose the endpoint API and Organization correctly, then you should have a single option of **dev**
104
106
105
107
!
106
108
107
-
9. Upon completion of all the inputs, you should see that the Organization and Space have been set and you will see any service instances or application instances from the target space.
109
+
1. Upon completion of all the inputs, you should see that the Organization and Space have been set and you will see any service instances or application instances from the target space.
108
110
109
111
!
110
112
111
113
[DONE]
112
114
[ACCORDION-END]
113
115
114
-
115
116
[ACCORDION-BEGIN [Step 3: ](Create a new project)]
116
117
117
118
1. Return to the **Explorer** view. From the SAP Business Application Studio Welcome tab, click **Start from template Create a new project**.
118
119
119
120
!
120
121
121
-
2. Choose **CAP Project** and click Start
122
+
1. Choose **CAP Project** and click Start
122
123
123
124
!
124
125
125
-
3. Use the following name for your project and click **Next**
126
+
1. Use the following name for your project and click **Next**
126
127
127
128
```Name
128
129
MyHANAApp
129
130
```
130
131
131
-
> **This name will be used in different steps**. It is recommended that you do not change it unless you remember to replace it in future tasks.
132
+
> **This name will be used in different steps**. It is recommended that you do not change it unless you remember to replace it in future tasks.
132
133
133
134
!
134
135
135
-
Choose `Node.js` as the runtime. Select `CI/CD Pipeline Integration`, `Configuration for SAP HANA Deployment`, and `MTA based SAP Cloud Platform Deployment` as the additional features for your project. Press **Finish**
136
+
Choose `Node.js` as the runtime. Select `CI/CD Pipeline Integration`, `Configuration for SAP HANA Deployment`, and `MTA based SAP Business Technology Platform Deployment` as the additional features for your project. Press **Finish**
136
137
137
138
!
138
139
139
-
4. The new project should be added to your workspace automatically.
140
+
1. The new project should be added to your workspace automatically.
140
141
141
142
!
142
143
143
-
144
144
[DONE]
145
145
[ACCORDION-END]
146
146
@@ -150,15 +150,14 @@ Before we create our SAP HANA project, we want to do a few more one-time configu
150
150
151
151
!
152
152
153
-
2. The wizard has also populated the `mta.yaml` configuration file with the necessary dependencies and parameters for each module. Open it in the code editor to explore it.
153
+
1. The wizard has also populated the `mta.yaml` configuration file with the necessary dependencies and parameters for each module. Open it in the code editor to explore it.
154
154
155
155
!
156
156
157
157
This file is the deployment descriptor and it is the glue that keeps all the micro-services together as a single application throughout its lifecycle. It declares the modules (applications or micro-services) and their dependencies with other micro-services or backing services. You can also use this file to inject variables into the environment variable `VCAP_SERVICES` of your application.
158
158
159
159
> This file is very sensitive to indentation and does not allow for tabs.
160
160
161
-
162
161
[DONE]
163
162
[ACCORDION-END]
164
163
@@ -170,17 +169,17 @@ The Cloud Application Programming Model wizard generates a project that supports
170
169
171
170
!
172
171
173
-
2. Save these changes
172
+
1. Save these changes
174
173
175
-
3. In the root of the project there is another important configuration file - the package.json. We are going to need to make several changes to this file as well.
174
+
1. In the root of the project there is another important configuration file - the package.json. We are going to need to make several changes to this file as well.
176
175
177
176
!
178
177
179
178
> No need to worry about the yellow underlining below the name of the package. This is just a hint and doesn't have any impact on the tutorial.
180
179
181
-
4. You can completely delete the `devDependencies` section of the `package.json`
180
+
1. You can completely delete the `devDependencies` section of the `package.json`
182
181
183
-
5. The rest of the changes will be in the `cds` section of the file. Replace this entire section of `package.json` with the following content
182
+
1. The rest of the changes will be in the `cds` section of the file. Replace this entire section of `package.json` with the following content
184
183
185
184
```json
186
185
"cds": {
@@ -208,7 +207,7 @@ The Cloud Application Programming Model wizard generates a project that supports
208
207
209
208
> These changes will alter the generated folder structure of the cds build operation. Content will no longer be placed into the gen folder for the db module but back into the source folders. This also will tell CAP to generate hdbtable artifacts instead of hdbcds. This is a critical change for SAP HANA Cloud compatibility. Finally the db.kind change to HANA tells CAP to use HANA at development time instead of SQLite.
210
209
211
-
6. Save the file
210
+
1. Save the file
212
211
213
212
[DONE]
214
213
[ACCORDION-END]
@@ -217,29 +216,29 @@ The Cloud Application Programming Model wizard generates a project that supports
217
216
218
217
We are using several dependent Node.js modules in our project. They are referenced in the `dependencies` section of the package.json file we were just editing. These dependencies need to be installed into your project before we can do any testing.
219
218
220
-
1. Open a new terminal
219
+
1. Open a new terminal
221
220
222
221
!
223
222
224
-
2. The terminal will open in the bottom right of the Business Application studio
223
+
1. The terminal will open in the bottom right of the Business Application studio
225
224
226
225
!
227
226
228
-
3. From the terminal run the command `npm install`
227
+
1. From the terminal run the command `npm install`
229
228
230
229
```shell
231
230
npm install
232
231
```
233
232
234
233
!
235
234
236
-
4. For one last change we need to adjust the content generated by the wizard for the **db** folder. The CAP wizard expects that you will use the `cds deploy` command to send content into HANA. However to use the HANA Projects view to deploy to HANA we need some additional files in the **db** folder. Mainly we need a package.json file that will run the `@sap-hdi-deploy` module. Rather than create this file manually, we will use an open source sample utility called hana-cli. From this same terminal window run the command ```npm install -g hana-cli```
235
+
1. For one last change we need to adjust the content generated by the wizard for the **db** folder. The CAP wizard expects that you will use the `cds deploy` command to send content into HANA. However to use the HANA Projects view to deploy to HANA we need some additional files in the **db** folder. Mainly we need a package.json file that will run the `@sap-hdi-deploy` module. Rather than create this file manually, we will use an open source sample utility called hana-cli. From this same terminal window run the command ```npm install -g hana-cli```
237
236
238
237
```shell
239
238
npm install -g hana-cli
240
239
```
241
240
242
-
5. After installation run the command ```hana-cli createModule```
241
+
1. After installation run the command ```hana-cli createModule```
243
242
244
243
```shell
245
244
hana-cli createModule
@@ -252,17 +251,17 @@ We are using several dependent Node.js modules in our project. They are referenc
252
251
253
252
You will use the local Git repository for basic version management.
0 commit comments