How to assign one Selection screen input field value into another field [ Not input ready] in SAP analytics report [ BW Query] using SAP HANA Exit
During the development of any SAP analytical report, we may required to access one selection screen variable value to be assigned to another selection screen variable. So that the second variable will bring all the relevant information from the database.
Out of many, there is one scenario where users enter the value one selection screen field in the SAP analytics report. After input same value gets assigned into another selection screen field [ Not input ready]. See the below flow shows how the “ZVAR_WBS_HIER” value gets assigned into the “ZHE_WBS” variable.
The Analytics report is built on top of the HANA CDS composite view using BW Query perspective as a report development tool.
CDS Composite View –
Report that builds on top of CDS view using SQL name as Transient Provider –
Below is the list of simple steps with screenshots for batter understating with the help of the HANA Exit variable, we can easily assign one selection screen field value after inputting get assigned into another screen field by writing a few lines of code in Class / Methods and with one HANA Exit variable.
This is the sample report selection screen where the user enters a value in “Project Group” and in the backend, the same value gets assigned in “Hierarchy ID” [ not input ready]
First, in the report build one SAP HANA Exit variable under the required field in query designer and add the HANA Exit variable ZHE_WBS in the filter tab.
SAP HANA Exit Variable details
Assign the variable in the respective object
The first variable technical details [ display on selection screen] and value enter this will get assigned into SAP HANA Exit variable “ZHE_WBS”
Selection Screen Variable Details
Add the variable in the Query Filter Tab area
Open the BAdI “RSROA_VARIABLE_HANA_EXIT” in ABAP Perspective
and the respective Class interface ZXX_CL_VARIABLE_HANA
Open BAdI In ABAP Perspective
Go to the method “GET_PROPERTICES”
Add below lines of code for SAP HANA Exit variable –
Go to the method “PROCESS” mention below –
Add below lines of code for SAP HANA Exit –
Open the Function Module – RRS_VAR_HANAEXIT in ABAP Perspective and add below 1st Set of code in the prescribed are
Add 2nd set of code as mentioned below
The 2nd set of code should be in the correct place as mentioned above or refer to the below snapshot. Else the SAP HANA Exit variable will not get the assigned value from the selection screen field.
Now save and activate the Function Module.
Again, come back to the Report selection screen and enter the relevant value in all the fields. [ using t-code RSRT for report execution ]
In Report Output under Variable Value Tab see the “Hierarchy ID” [ SAP HANA Exit Variable ] get assigned from selection screen value
In some more details how the selection screen field value gets assigned with technical detail.
Same report selection screen and respective output in Fiori tiles
This document shows in the SAP analytics report how we can assign one selection screen value into another selection screen value using SAP HANA Exit during the execution mode [ After input].