SAP HANA Table function – Calculation View Wrap

This tutorial is a continuation of the SAP HANA Table Function Part-1 tutorial. Please read it first if you have directly landed on this page.

To be used further, SAP HANA table functions need to be wrapped around SAP HANA graphical calculation views graphical calculation view .

To achieve this, switch back to the Systems tab.

hana table function with calculation view

In you package, right click on the Calculation views folder and click New.

hana table function with calculation view




1

You would already be aware of these steps to create calculation view if you’ve gone through the HANA tutorials. We follow the same steps here. We fill in the Name and label of this view as SALES_TAB_FN. The data category has been switched from CUBE to DIMENSION since we don’t have a measure in our data. It’s just 2 attribute fields that will come in from the table function.

hana table function with calculation view

We will not create any additional logic here. All we have to do is add the table function to this projection seen in the Calculation view below.

hana table function with calculation view

Adding the SAP HANA Table function to the projection node

To add the table function, right click on the projection and select “Add Objects”.

hana table function with calculation view

A search box opens up. Type in the object name you wish to search for – the table function name in this case.

hana table function with calculation view

As we type in the table function name, the search returns the below results. Select the one with the package path suffix – the first one in this case.

hana table function with calculation view


1

As seen below, the table function gets added to the projection and the fields are also available to be selected to the output.

It appears as if we were adding a simple table to a graphical view but at the back end, we have a SAP HANA table function providing the entire logic for this output.

hana table function with calculation view

Select the fields both the fields to send to output in the same way we did in the graphical view tutorial .

Once done, activate the calculation view.

hana table function with calculation view

Run a data preview and you would see the output is what we would expect from the code we wrote inside the table function.

hana table function with calculation view

This ends the second part of the SAP HANA Table function tutorial. Move on to the next page for the third part.

<<Previous Page                                                                                                                               Next Page>>

Tagged .

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *