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
# Access a Classic Schema from SAP Web IDE Full-Stack
13
+
12
14
<!-- description --> Access data in a plain or replicated schema from an HDI container.
13
15
14
16
## Prerequisites
15
-
- This tutorial is designed for SAP HANA service for SAP Business Technology Platform. Consider newer tutorials designed for SAP HANA Cloud.
16
-
- You have access to the database and SAP BTP cockpit.
17
-
- You have created a multi-target application with a database module [as explained in this tutorial](haas-dm-create-db-mta).
18
-
- Optionally, you have created a remote source [as explained in this tutorial](haas-dm-connect-sdi).
19
17
20
-
## Intro
21
-
>**This tutorial cannot be completed with a trial account.**
18
+
- This tutorial is designed for SAP HANA service for SAP Business Technology Platform. Consider newer tutorials designed for SAP HANA Cloud.
19
+
- You have access to the database and SAP BTP cockpit.
20
+
- You have created a multi-target application with a database module [as explained in this tutorial](haas-dm-create-db-mta).
21
+
- Optionally, you have created a remote source [as explained in this tutorial](haas-dm-connect-sdi).
22
22
23
23
## You will learn
24
-
- How to create a plain schema, with a table and user to simulate a replicated schema
25
-
- How to create a user-provided service to access a database in SAP HANA service for SAP BTP
26
-
- How to grant permissions to the technical users in your HDI container to access the database
24
+
25
+
- How to create a plain schema, with a table and user to simulate a replicated schema
26
+
- How to create a user-provided service to access a database in SAP HANA service for SAP BTP
27
+
- How to grant permissions to the technical users in your HDI container to access the database
27
28
28
29
This tutorial is meant to be an example of cross-container access. Simple data models and loading mechanisms were chosen to simulate a schema replicated using tools such as SAP Landscape Transformation or an ABAP schema.
29
30
30
31
For more information on this process and additional syntax options, refer to the [official documentation on SAP Help](https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/latest/en-US/a260b05631a24a759bba932aa6d81b64.html).
31
32
32
33
If you are looking for the steps for an on-premise SAP HANA instance with XS Advanced, such as SAP HANA, express edition, [refer to this tutorial](xsa-create-user-provided-anonymous-service).
33
34
35
+
## Intro
36
+
37
+
>**This tutorial cannot be completed with a trial account.**
38
+
34
39
---
35
40
36
41
### Create a plain schema
37
42
38
-
39
43
Connect to SAP Web IDE Full Stack and enter the Database Explorer. You will see your instance of the SAP HANA database.
40
44
41
45
> If you cannot see the database, try entering the database explorer from the Database Cockpit and make sure the setting in `Preferences->Database Explorer` are set to the correct region.
@@ -50,7 +54,7 @@ You will create a SQL role and assign it to the user `PLUSR` with the permission
50
54
CREATESCHEMA "PLAIN";
51
55
CREATEUSERPLUSR PASSWORD "HanaRocks01" NO FORCE_FIRST_PASSWORD_CHANGE ;
grantSELECT, UPDATE, INSERT, DELETE, EXECUTE, SELECT METADATA ON SCHEMA "PLAIN" TO CCROLE with grant option;
@@ -80,10 +84,8 @@ Use the green play button or press **`F8`** to execute the statement.
80
84
>
81
85
> 
82
86
83
-
84
87
### Load data
85
88
86
-
87
89
Download [this CSV file](https://raw.githubusercontent.com/SAPDocuments/Tutorials/master/tutorials/haas-dm-access-cross-container-schema/plain.csv) into your local computer.
88
90
89
91
Use the search help to locate schema `PLAIN`.
@@ -116,11 +118,8 @@ You should see the wizard has imported 4 records
116
118
117
119
Right-click on the table and choose **Open Data** to see the records loaded into the table.
118
120
119
-
120
-
121
121
### Create a user-provided service
122
122
123
-
124
123
You now have a schema with a table and data in it. You have also created a user called `PLUSR` with permissions to perform basic operations on that schema. You will now create a user-provided service to access the schema through the user `PLUSR` from your Multi-Target Application.
125
124
126
125
Use **`Tools -> SAP Cloud Platform Cockpit`** to open the cockpit.
@@ -156,10 +155,8 @@ Call the service **`CC_ACCESS`** and use the code below in **Credentials**
156
155
157
156
Press **Save**.
158
157
159
-
160
158
### Configure the service for access
161
159
162
-
163
160
You will now add the user-provided service as a dependency and configure it as part of a database module. You will also set the original HDI container as the default service for database artifacts.
164
161
165
162
Go back into SAP Web IDE Full-Stack. Open the file `mta.yaml` in the **MTA Editor** and use the **+** sign to add a resource.
@@ -217,10 +214,8 @@ If you switch to the **Code Editor** for the `mta.yaml` file, it should look sim
217
214
218
215

219
216
220
-
221
217
### Grant permissions to the technical users
222
218
223
-
224
219
You will now create an artifact that grants access to the two technical users of your HDI container. These are not real users, but technical ones.
225
220
226
221
Create a new file under `db`.
@@ -250,12 +245,8 @@ And use the following code in it:
250
245
251
246
**Save the file**.
252
247
253
-
254
-
255
-
256
248
### OPTIONAL - Grant access to a remote source
257
249
258
-
259
250
**This step works only if** you have created a remote source to access a text file [using SAP HANA service smart data integration for SAP BTP in this tutorial](haas-dm-connect-sdi), go back to the Database Explorer and open a new SQL console to your instance of SAP HANA service for SAP BTP.
260
251
261
252
Execute the following SQL command
@@ -267,7 +258,6 @@ grant "CREATE VIRTUAL TABLE", "DROP", "CREATE REMOTE SUBSCRIPTION", "PROCESS REM
267
258
268
259

269
260
270
-
271
261
> Alternatively, you can grant the same permissions to the user in the user-provided service, `PLUSR`, and create a separate grants file with them or a new role.
272
262
> Here is an example for that `.hdbgrants` file
273
263
>
@@ -292,11 +282,8 @@ grant "CREATE VIRTUAL TABLE", "DROP", "CREATE REMOTE SUBSCRIPTION", "PROCESS REM
292
282
293
283

294
284
295
-
296
-
297
285
### Create synonyms
298
286
299
-
300
287
You can now create a synonym to access the table in the plain schema. Create a new file in `db\src\data`
301
288
302
289

@@ -321,10 +308,8 @@ Add a new record with name `REGIONS`, object name `REGIONS` and schema `PLAIN`
321
308
322
309

323
310
324
-
325
311
### Create a view
326
312
327
-
328
313
You can now use the table in the classic schema with other objects created in your HDI container. In `data`, create a new database artifact
329
314
330
315

@@ -354,11 +339,8 @@ Right-click on the view and choose **Open Data**. Paste the generated SQL statem
354
339
355
340

356
341
357
-
358
-
359
342
### Troubleshooting insufficient privileges
360
343
361
-
362
344
**Error**: Insufficient privilege: Detailed info for this error can be found with `guid` <GUID>
363
345
364
346
You can see what is missing by executing the following statement in a SQL console connected to the database
@@ -371,6 +353,4 @@ This procedure will show the session user name, the technical user (HDI object o
371
353
372
354
Make sure the user in the user provided service has permissions for `SELECT` and `SELECT METADATA` with grant option.
0 commit comments