SAP BW powered by SAP HANA or BW/4HANA provides means of integrating native HANA models into the BW environment. One such scenario is the consumption of HANA calculation views in composite providers.
In HANA views, we use input parameter to restrict the data based on user input provided. We do have some limitations in this approach as the input parameter accepts only single value and ranges are not supported.
In this blog, we are going to see how to consume the input parameter in BW and pass values from BEx.
Step 1: Create a calculation view in HANA.
Step 2: Create input parameters based out of Calendar day. In our case, we are creating two input parameters and show how to handle ranges bypassing “from” and “to” values from BEx.
Step 3: Create an expression as shown below. Use the input parameter we had created already. This would act as a filter to the entire view.
If you try to preview the data, you can see that the input parameters are being requested.
Step 4: Create a Composite Provider (HCPR) on top of this HANA view and consume the input parameters as well.
Step 5: Create a BEx query on top of this HCPR. Filter the query based on the input parameter fields using variables. Make sure that the variable created accepts only “Single value”.
You can also use fixed value as a filter or populate the variable value through customer exit.
Step 6: Run the query in RSRT and fill in the required fields.
You can see that the values we have entered are passed into the HANA view through the input parameters and the data gets filtered accordingly.
- Do not use the fields mapped to input parameter in drill-down as it will throw an error. They are just placeholders to pass the values to the HANA view.
- Input parameter currently supports the only single value and in case you create variables with range/selection, BEx will throw an error. You can follow the approach shown above in case you need to deal with ranges.
Know more about Visual BI Solutions SAP/BW Services offerings here.