Prerequisite
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.
Variable Details
Report Background
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 –
CDS Composite View
Report that builds on top of CDS view using SQL name as Transient Provider –
BW Report Use CDS SQL Name
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]
Step 1»
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
Step 2»
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
Step 3»
Open the BAdI “RSROA_VARIABLE_HANA_EXIT” in ABAP Perspective
and the respective Class interface ZXX_CL_VARIABLE_HANA
Open BAdI In ABAP Perspective
Step 4»
Go to the method “GET_PROPERTICES”
Add below lines of code for SAP HANA Exit variable –
Step 5»
Go to the method “PROCESS” mention below –
Add below lines of code for SAP HANA Exit –
Step 6»
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.
Step 7»
Again, come back to the Report selection screen and enter the relevant value in all the fields. [ using t-code RSRT for report execution ]
Step 8»
In Report Output under Variable Value Tab see the “Hierarchy ID” [ SAP HANA Exit Variable ] get assigned from selection screen value
Step 9»
In some more details how the selection screen field value gets assigned with technical detail.
Step 10»
Same report selection screen and respective output in Fiori tiles
No comments:
Post a Comment