cancel
Showing results for 
Search instead for 
Did you mean: 

Creating views and procedures

Former Member
0 Kudos

Hello friends,

I have few ECC tables replicated onto HANA system. Now I need to create views and procedures for those tables.

I am familiar with one method i.e to right click on table and choose to "CREATE VIEW" or right click on procedures inside schema and choose "NEW Procedure" .

But now, I would like to know how I could accomplish the same with the way exaplined by @Thomas_Jung in the tutorial on OpenSap. I tried this for example:


schema = "SYSTEM";

query = "SELECT T0.\"REFID\", T0.\"LIFNR\", from

\"SYSTEM\".\"Tables::_ETRAG\" T0  ";

Please do not mock if this incredibly wrong, but it was just a try which did not work as expected. Normally we declare something like this:

\"SAP_HANA_EPM_DEMO\".\"sap.hana.democontent.epm.data::purchaseOrder\"

But for the tables which I have are not defined and dont exist in the repository. They are replicated using BODS.

Do anyone have ideas how I could go with the following.

Any help would be appreciated. Thanks

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you are building a view on catalog tables (as opposed to repository tables), then you don't need the namespace part at all. Just supply the schema.table_name.  If your table name is _ETRAG and its really in schema SYSTEM (which seems a bit odd) then the syntax would be:

query = "SELECT REFID, LIFNR FROM SYSTEM._ETRAG ";

If you just have one table, you don't need the table alias of T0. Of course if you just have one table, do you really need a view?  Also you don't have to quote the field names, table names or schema if they are all upper case and don't contain any special characters. This is generally the case with replicated tables from ERP.

Former Member
0 Kudos

Hello Thomas,

Thanks fory our quick reply. You are right, I should not use the namespace at all. I used T0 because I copy pasted it from an example and I accept that I was too lazy to make the necessary formatting.

Thanks you so much. That was really helpful.

Answers (0)