BW accelerator enables quick access to any data in the InfoCube with low administration effort and is especially useful for sophisticated scenarios with unpredictable query types, high volumes of data and a high frequency of queries.
But in some of the cases like where we have non cumulative Key figures and Exception aggregation on the Key Figures, the Queries will not run on BWA due to the large number of records processed and hence might fail when the query hits the BWA In these cases we need to switch off the BWA to those set of queries and let those queries hit the Aggregates instead.
Suppose if we want a query explicitly not to use the SAP Netweaver BW Accelerator (BWA). To do this, we must change an internal attribute of the query.
How to switch off the BWA on the Queries:
Go to SE16 RSRREPDIR table and Check the entries for the Query
By default the field NOHPA will be blank which means that this query is hitting the BIA.
To switch off the query on BWA, this NOHPA indicator should be flagged as ‘X’. To update the same follow the below steps:
Create a Z Program for the same and copy the code mentioned below:
REPORT ZZ_SET_QUERY_NOHPA_FLAG.
TYPE-POOLS: rri5.
DATA: l_compid TYPE rsr_s_compkey-compid,
l_r_dta TYPE REF TO cl_rsd_dta,
l_s_dta TYPE rsd_s_dta,
l_s_repkey TYPE rsr_s_compkey,
l_s_rkb1d TYPE rsr_s_rkb1d.
SELECT-OPTIONS: compid FOR l_compid NO INTERVALS.
PARAMETER: nohpa TYPE c AS CHECKBOX.
LOOP AT compid.
CLEAR l_s_repkey.
l_s_repkey-compid = compid-low.
CALL FUNCTION 'RRI_REPDIR_READ'
IMPORTING
e_s_rkb1d = l_s_rkb1d
CHANGING
c_s_repkey = l_s_repkey
EXCEPTIONS
entry_not_found = 1.
IF sy-subrc <> 0.
WRITE: /, 'QUERY NOT FOUND ' , compid-low.
CONTINUE.
ENDIF.
* Authority for the change query
CREATE OBJECT l_r_dta
EXPORTING
i_infoprov = l_s_rkb1d-infocube.
CALL METHOD l_r_dta->dta_get_info
IMPORTING
e_s_dta = l_s_dta.
CALL FUNCTION 'RSSB_AUTHORITY_COMP_CHECK'
EXPORTING
i_infoarea = l_s_dta-infoarea
i_infocube = l_s_rkb1d-infocube
i_comptype = l_s_rkb1d-comptype
i_compid = l_s_rkb1d-compid
i_actvt = '02' "rssb_c_auth_actvt-change
EXCEPTIONS
user_not_authorized = 4.
IF sy-subrc = 4.
WRITE:/, 'NOT AUTHORIZED TO CHANGE QUERY ' , l_s_repkey-compid.
CONTINUE.
ENDIF.
IF l_s_rkb1d-nohpa = nohpa.
WRITE:/, 'NOHPA ALREADY SET TO "', nohpa, '" FOR QUERY', l_s_repkey-compid.
CONTINUE.
ELSE.
l_s_rkb1d-nohpa = nohpa.
l_s_rkb1d-objstat = rs_c_objstat-inactive.
ENDIF.
* update active version
CALL FUNCTION 'RRI_REPDIR_MODIFY'
EXPORTING
i_s_repkey = l_s_repkey
i_s_rkb1d = l_s_rkb1d.
* update modified version
l_s_rkb1d-objvers = l_s_repkey-objvers = rs_c_objvers-modified.
IF l_s_repkey-compuid+0(1) NE '!'.
CALL FUNCTION 'RRI_REPDIR_MODIFY'
EXPORTING
i_s_repkey = l_s_repkey
i_s_rkb1d = l_s_rkb1d
EXCEPTIONS
entry_not_found = 0.
ENDIF.
WRITE:/, 'NOHPA SUCCESSFULLY CHANGED FOR QUERY', l_s_repkey-compid.
ENDLOOP.
Save and activate the Program.
When you execute the above program then it will ask for the COMPID (query technical name) and also you will have a check box to select or deselect the NOHPA flag:
Press F8 once after you enter the parameters, this will update your RSRREPDIR table with NOHPA as ‘X’.
In this way you can set the NOHPA flag as 'X' and can switch off the BWA on the specific Queries.
In Some cases we will not have authorization to SE38 in Production environment, then you will need to create a separate Transaction code for the same.