Skip to Content
Technical Articles

How to Create, load and consume table inside calculation view in HANA Web IDE 2.0

Introduction:

In this quick tutorial, we’ll learn detailed step by step procedure to create, load and consume table in SAP HANA calculation view using Web IDE 2.0.

We have a scenario where user wants to create a custom user defined table and load it with .csv file and later consume same created table in HANA calculation view with predefined business logic in a Web IDE 2.0

Solution:

Please note for demonstration purpose we have created a dummy table structure with random data with the assumptions that while working in real time scenarios developer have proper table structure and data to consume. To achieve above mentioned scenario we have to follow below described steps.

Steps to be followed:

  • Create a new folder under the src folder by right-clicking in the folder and select New->Folder.
  • Enter a Folder Name (“DEMO”) and click OK.
  • File for Structure of table: Create below text file “ZT_DEMO_TABLE” and save it as “.hdbtable” extension. Where ZT_DEMO_TABLE is name of table and MATERIAL, PLANT, CLIENT, SALES_ORG, QTY are fields of that table.
  • File for Content of table: Create below CSV file in excel with required fields and data in a proper sequence as per above structure.
  • File to Load data: Create below text file “ZT_DEMO_TABLE_DATA_POPULATION” and save it as “.hdbtabledata” extension. Note: Sequence of fields should be same as above two files.
  • Importing Files to Demo Folder: To import files right click on Demo Folder and select import then file or project. Import all three files created in step 3, 4 and 5.
  • Building (Activating) files: Once all three files imported to the system now right click on file and select build and then build selected file. Once build completes go for remaining two files in a sequence as mentioned below:
  • To view table data: Select data explorer tab Expand system and select table option then search table in search window. Once you find table right click on it and say open data
  • Create Calculation view: To create calculation view, open development mode Right click on Demo folder and select new Calculation View and name it as “CV_TABLE_USE_DEMO”Use business logic to add created table in Calculation view, for demo we just added to aggregation node Search table select it and say finish Add all fields to output and set default client as blank in view properties
  • Save, build (Activate) view and do data preview: Select below button to save the created view and then right click on view name and build it Once build is completed right click on view and say data preview

Conclusion:

This blog post gave an overview of steps that you need to follow to create, load and consume table in HANA calculation view in Web IDE 2.0

I hope you find this blog post interesting and helpful.If I have missed anything important please feel free to add the same in comment box.

Thank You

Happy Learning!!!

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