Skip to Content
Author's profile photo Tom Flanagan

[SAP HANA Academy] Modeling: Calculation Views in Web IDE [SPS09]

In a tutorial video the SAP HANA Academy’s Tahir Hussain Babar (aka Bob) demonstrates some of the new modeling features in SAP HANA SPS09. Bob shows how to build both graphical and scripted calculation views in the SAP Web IDE. Check out Bob’s video below.

Screen Shot 2015-01-19 at 11.51.55 AM.png

(0:22 – 1:12) Granting Developer Rights in SAP HANA Studio

First Bob allocates rights within the SAP HANA Studio using the system user. Note a specific user can be created that has the necessary rights to build calculation views in the SAP Web IDE. The rights the system user needs come from running a package called GRANT_ACTVIVATED_ROLE that allocates the developer role to the user system. Once the below syntax is executed in a SQL console launch a web browser (in this example Google Chrome).

CALL GRANT_ACTIVATE_ROLE(‘sap.hana.xs.ide.roles::Developer’,’SYSTEM’);

(1:12 – 5:45) How to Create a Graphical Calculation View in SAP Web IDE

Go to the SAP Web IDE by entering a URL similar to the one shown below.


Log in with your user credentials. Notice that the SAP WEB IDE is based upon call libraries.

Bob builds a new package by right clicking on Content and choosing New and then Package. Bob names the package CV for calculation views. Bob then right clicks on the newly created CV packages and chooses New and then Calculation View. Note that currently the SAP Web IDE only supports graphical and scripted calculation views.

Bob names the calculation view Employee_CV. Bob will use a table in a schema called Bob’s Data for this example. He also used Employee_CV as the label. He chooses that the calculation view be graphical and selects CUBE as the Data Category before clicking create. Note that some features such as unioning are not supported.

In the SAP Web IDE, just like in SAP HANA Studio, you can create a Join and convert from projections or convert to aggregations if your using either dimensions or cubes.

Bob shows how to select a data set by clicking on Aggregation in the canvas and then clicking on the add button in the Data Sources box. Bob enters EMPLOYEE to search his repository for his table and then selects and chooses his MYEMPLOYEES table. By clicking on the table Bob expands it to see it’s four columns. Bob chooses the columns ROLE and SALARY and then clicks the Add to Output button.

Next Bob clicks on Semantics in the canvas and sees that it has already delegated that ROLE is a dimension and SALARY is a measure. By clicking save Bob activates the calculation view.

To view the data Bob clicks on the green play button. Bob notes the SQL statement that the view executes and also the resultant data that is displayed on the bottom of the screen. You have the option to export the data, change the layout, refresh the data and rerun the SQL script. Also, there are tons of options to set the table prosperities.

(5:45 – 8:00) How to Create a Scripted Calculation View in SAP Web IDE

First Bob clears the console to shut down the view. Following the same steps as before Bob chooses to create a new calculation view but names it EMPLOYEES_CV_S and selects Script instead of Graphical before clicking create.

By default you are given a simple SQL statement. Bob deletes part of the default SQL script and enters his own as shown below.

Screen Shot 2015-01-19 at 12.01.38 PM.png

Just as in the SAP HANA Studio you must choose the columns you wish to output. So on the right hand side Bob deletes the current column and then enters ROLE followed by a ; so he can choose the data type. For the ROLE column he chooses BINTEXT. Bob then adds another column and enters AVERAGE;BIGINT.

Bob clicks on the column tab at the top to examine his newly create columns. Once again after Bob click the save button his scripted calculation view is created.  After clicking the play button Bob can examine the data and sees that it’s the same as his previous example.

(8:00 – 9:27) SAP Web IDE Calculation Views Used in SAP HANA Studio

Bob notes that even though the pair of calculation views were created in SAP Web IDE they can also be used in SAP HANA Studio.  Bob sees the same CV package in his content folder in SAP HANA Studio. In the CV package Bob sees two activated calculation views. Bob uses data preview on both of the calculation views to see it’s raw data and script.

Check out the SAP HANA Academy’s series of over 75 videos on What’s New with SAP HANA SPS09 as well as the playlist detailing the new Modeling features for SPS09.

SAP HANA Academy over 800 free tutorial videos on using SAP HANA.

Follow @saphanaacademy

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.