Personal Insights
Technical Name of HANA Calculation View from BW (HCPR) shows system generated name as 2H*
Introduction:
In Mixed Modelling (SAP HANA and BW) Architecture, we use Composite Provider to consume the data from both HANA and BW Objects. Composite Provider is a replacement of Multi-Provider in BW on HANA and BW4HANA Modeling.
Requirement/ Issue Observed:-
We have an existing Composite Provider which is built on top of four Calculation View.
We are looking into some Key Figures and wanted to find out from which calculation view those values are coming, so to find the source of this data, we looked into the Composite Provider display data option for the Field InfoProvider (0INFOPROV).
This field does not provides the actual Technical name of the underlying Calculation View, instead it displays some system generated name starting with 2H.
See the Field InfoProvider (0INFOPROV), it shows system generated name starting with 2H.
One cannot identify which calculation View it is, by this Information.
How to identify the source Calculation View of Composite Provider?
Solution:-
Please created a Z Program, the code is given below
REPORT ZBW_HCPR_CLV. PARAMETERS: p_hcpr type RSOHCPRNM. Data: ip_name type RSINFOPROV. Data: l_t_hana_xref TYPE CL_RSO_BW_HANA_OBJXREF=>NT_T_HANA_XREF. FIELD-SYMBOLS: <ls_xref> like line of l_t_hana_xref. CALL METHOD CL_RSO_RES_HCPR_DB=>READ_HCPR EXPORTING I_HCPRNM = p_hcpr I_OBJVERS = 'A' IMPORTING E_T_HANA_XREF = l_t_hana_xref. loop at l_t_hana_xref ASSIGNING <ls_xref>. CALL METHOD CL_RODPS_HANA_MODEL=>HASH_ODPNAME EXPORTING I_PACKAGE = <ls_xref>-namespace I_NAME = <ls_xref>-object_name RECEIVING R_ODPNAME = ip_name . CONCATENATE '2H' ip_name into ip_name. write: / <ls_xref>-namespace, <ls_xref>-object_name, at 100 ip_name. endloop.
Explanation of Program:
The Program will call this Method READ_HCPR of the Class CL_RSO_RES_HCPR_DB with input as our given Composite Provider tech name. The result of this Method brings the Package path and the actual technical name of the Calculation View in the field NAMESPACE and OBJECT_NAME respectively.
Now this fields NAMESPACE and OBJECT_NAME will be passed into another Method HASH_ODPNAME of Class CL_RODPS_HANA_MODEL one by one in loop to get its mapped ip_name.
At the end of the program a prefix 2H is added into the result ip_name
This is the same name that is seen in the Field InfoProvider (0INFOPROV). While checking the Composite Provider data.
Conclusion:
Program Execution: Execute the Program, and put the Composite Provider in the selection Screen.
The result will show the actual Technical name (not 2H*) of calculation View along with their package path.
Note: If a composite provider “A” having underlying composite Provider “B” along with other calculation Views then result of the program when executed for “A” will give the tech name of underlying Calculation View of Composite Provider “A” only.
To get the calculation View of composite Provider “B” run the program again with “B” in the selection Screen.
References:-
https://blogs.sap.com/2018/12/14/implementing-mixed-modeling-in-bw4hana-using-composite-provider/
In the blog above I have kept a Note mentioning limitation of this code, where If a composite provider “A” having underlying composite Provider “B”. Then the ABAP program executed for “A” will show Calculation View lying only under HCPR “A” and not under HCPR “B”.
Now I have modified this Code to overcome this Limitation. This code will show all the underlying calculation View of HCPR “A” as well as the Calculation view lying under HCPR “B” when execute for the top HCPR “A”.
[You are Welcome to modify as per your requirement].
REPORT ZBW_HCPR_CLV.
PARAMETERS: p_hcpr type RSOHCPRNM.
Data: ip_name type RSINFOPROV,
p_hcpr1 type RSOHCPRNM.
Data: l_t_hana_xref TYPE CL_RSO_BW_HANA_OBJXREF=>NT_T_HANA_XREF,
l_t_hana_xref1 TYPE CL_RSO_BW_HANA_OBJXREF=>NT_T_HANA_XREF,
l_t_hcpr_xref TYPE RSO_T_HCPR_XREF.
FIELD-SYMBOLS: <ls_xref> like line of l_t_hana_xref,
<ls_xref1> like line of l_t_hcpr_xref.
CALL METHOD CL_RSO_RES_HCPR_DB=>READ_HCPR
EXPORTING
I_HCPRNM = p_hcpr
I_OBJVERS = ‘A’
IMPORTING
E_T_HCPR_XREF = l_t_hcpr_xref
E_T_HANA_XREF = l_t_hana_xref.
DELETE l_t_hcpr_xref WHERE tlogo_dep EQ ‘AREA’.
SORT l_t_hcpr_xref BY objnm_dep.
DELETE ADJACENT DUPLICATES FROM l_t_hcpr_xref COMPARING objnm_dep.
loop at l_t_hcpr_xref ASSIGNING <ls_xref1>.
move <ls_xref1>-objnm_dep to p_hcpr1.
CALL METHOD CL_RSO_RES_HCPR_DB=>READ_HCPR
EXPORTING
I_HCPRNM = p_hcpr1
I_OBJVERS = ‘A’
IMPORTING
E_T_HANA_XREF = l_t_hana_xref1.
endloop.
APPEND LINES OF l_t_hana_xref1 to l_t_hana_xref.
loop at l_t_hana_xref ASSIGNING <ls_xref>.
CALL METHOD CL_RODPS_HANA_MODEL=>HASH_ODPNAME
EXPORTING
I_PACKAGE = <ls_xref>-namespace
I_NAME = <ls_xref>-object_name
RECEIVING
R_ODPNAME = ip_name .
CONCATENATE ‘2H’ ip_name into ip_name.
write: / <ls_xref>-namespace, <ls_xref>-object_name, at 100 ip_name.
endloop.
Hi Prem,
Tried giving the name, 2H* in the READ_HCPR() method, but it says object not found. Missing anything?
Regards
Hi Kiran,
Its the other way around , you need to put the HCPR name and it displays the CLV behind it in on both actual CLV name as well as it's 2H* name.
Thank you Prem, exactly what I needed!
Hello together,
is there any way to display Tech.Name or Description of the involved HCV in the report drilldown (by 0INFOPROV) directly? Report users will not be executing the programs in the back-end to find out what part-providers are behind the data 🙂
Danny.
Hi Danny,
I don't think in the report we can do that.
Please let me know if you find anything like that.
BR
Prem