Sunday, 21 January 2018

Create a value help (for input parameter / variable) in HANA Calculation view

Input parameters and Variables are two diferent mecanism that HANA provide us to get interaction with final users.

In some cases, we need to include an input parameters / Variables with value help with the propose of provide more information when user have to choose an input value.

In this post I’m goint to explain the steps to create a custom value help and some tips that you have to take in mind to get start with this topic.

Assumptions


I’m going to assume readers has HANA envairoment with SAP ECC tables replicates (like SAP ECC on HANA,  or SAP ECC – SLT – HANA)
We use HANA 2.0 SP01 with Eclipse Neon (4.6.3) to do this tutorial

Problem phase:


Requirement

Customer needs a report where he can identify how many materials are there by material type.

Analysis

We know that this basic information of materials are in MARA table, so we need to develop a HANA view (Calculation view), count materials by material type and add material type value help as an input parameter.

Solution phase:


Create calculation view

We created a calculation view called CV_001_MATERIAL_BY_MATTYPE

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Here we need to add MARA table as a projection and select MANDT, MATNR, and MTART fields

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

After that we need to creat a counter, so open Agregartion and add all fields to output 
SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Now in the output section, create a new counter (by material) in calculated colums

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Now before create an input parameter we need to have a value help HANA view, so, lets go to create it.

Create calculation view for value help


CV_0002_MATTYPE_VALUE_HELP

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Here we need to perform a text join with T134 (Material typs) and T134T (Material type text)

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Now it is an importat step, we need to add in semantics, a label colum info for material type field

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

With this our Value help view is ready, so activate it (Dont forget add a measure field, like counter, to activate the view)

Implement input parameter with custom value help view

In CV_001_MATERIAL_BY_MATTYPE‘s semantics choose Parameter/Variable tab and create an input parameter

◈ Name: I_MaterialType
◈ Label: Material type
◈ Parameter type: Column
◈ View/table for value help: use  CV_0002_MATTYPE_VALUE_HELP
◈ Reference column: choose MTART field

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Finally we need to add a filter with this parameter, so open MARA projection and apply a filter in MTART field

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

Thats it, if we use the data preview, we can see that the value help is working fine

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

by choosing ZSER material type we can see there is 11 materials created with this type

SAP HANA Tutorials and Materials, SAP HANA Certifications, SAP HANA Guides, SAP HANA Calculation

What about variables?


Is the same process, just choose variables insted input parameter and apply the same steps

No comments:

Post a Comment