Skip to Content

How to put loop endloop in Graphical Calculation View in HANA studio?

Jan 30, 2017 at 06:05 AM


avatar image

I have a requirement to convert ABAP code in SAP HANA Calculation Graphical View, where I am looping an internal table and calculating value of a field in each iteration of loop. In Graphical Calculation View I am not sure how to put this requirement, any help is really appreciated.

Another requirement is to put Order by on 2 columns in same Calculation Graphical View, where Rank node allows Order by on only one column.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Florian Pfeffer
Jan 30, 2017 at 07:00 AM

Regarding your first requirement for a loop I think depending on your calculation it might be easily solved a a calculated column. The expression of the calculated column is applied by default to each data record of the data source of a node. One comment regarding the "ABAP code conversion": Please do not try to convert your ABAP code 1:1 into HANA native objects. This will lead in most cases to performance and other issues. Try to use the new options and patterns of HANA.

Regarding the requirement to use two columns for ordering in a rank node it has to be said that in the graphical tools only one order column is supported at the moment. An option to use two order by columns would be, to use a table function as data source, in which you implement the "rank node" functionality by yourself using Window Functions.


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Florian,

Thank you for your answer on this. Could you please explain more about Windows Functions or how to use them in HANA studio??

Any example will really help in this.


Shiromani Soni


In my answer the official documentation for Window Functions is linked. There you can find all information about it and examples. You can also check the videos of the SAP HANA Academy regarding Window Functions (e.g. SQL Window function: Rank).


RUFUS SAMUEL Jul 10, 2017 at 02:26 PM

Hi Florian

Can you please give us more explanation on how to use Loop Endloop in Calculation view ??

Rufus Samuel

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I guess you missed Florians' point: there is no LOOP... ENDLOOP in calculation views.

Instead, many requirements that have traditionally been solved with loops in ABAP can be solved differently in calculation views.

If all fails, and you really really really like to stick to your loops, then what you can do is to create a table user-defined function and use this TUDF as a data source in the graphical calculation view.

Venkata Krishna Chaitanya Bodapati Feb 01 at 12:28 AM


I have a similar issue (for some reason converting standard FM reading change logs for Variant config changes, easier way is to go for calc columns and populate. However I am stuck with the below. Looks/sounds simple but using Calc Graphical HANA views, I tried Calc columns but not able to write back .

All I am trying to do is read Symbolid from change indicator 'E' and paste it to outval for change ind 'I'

In ABAP we can achieve via Loop within a loop etc.

Thanks Krishna

capture.png (8.1 kB)
10 |10000 characters needed characters left characters exceeded