We have many articles available to talk about performance tuning in HANA models and even so many articles for best practices too.
This document something will deal about importance of building blocks (base views) and how to build the model with base views and how that support and reduce the time when there is any major or minor changes in that model.
We have built a calculation view using 4 to 5 projections and joins. On top of the model, we have built variables which will act as a prompt in Reporting tools like Web Intelligence, Crystal Reports, Explorer, etc.
In Future, if there is a changes in the applied logic as we need to modify the tables or need to add new tables then it will take more time to modify the model to accommodate the new logic if the existing model is simple and without any building blocks.
Consider we have model like below, we need to add new table after Join_2.
- We don’t have any building blocks in this models here, all the projections are getting data from straight table.
- This has VBAP, MARA, MAKT tables in each projections and joined as per joining conditions.
- All the naming conventions (technical names to business names) are taken place in aggregation layer.
If we got new Requirement from Client as like below,
- Add table KNA1 to get customer name on the above model.
Following changes required,
- Need to remove the joining line between Join_2 and Aggregation which will erase the naming conventions and variable mappings.
- Need to add KNA1 table after that naming conventions should be applied as before.
- Remap the variables.
To avoid the above steps, we can have this model with building blocks.
For the above tables I have created a 2 building blocks, building blocks is nothing but the base views.
- View 1 – MARA & MAKT
- View 2 – VBAP & VBAK
The above view 1 is used in projection_1 and View 2 is used in Projection_2.
If we got new update to add new table KNA1, then we add that in base view 2 and we can select only the fields in main model.
It will not affect the naming conventions or variable mappings.
Always do the naming conventions in base level itself.
Thanks and let me know, if any further explanation needed on this.