SAP Function RSSB_GET_AUTHS_FILTERED - BI Reporting Authorizations: Authorized Values Filtered

Parameter Reference Type Length Default Optional Text
I_CLEAR RS_BOOL C 1 RS_C_FALSE X Deleting Saved Filters
I_INFOPROV RSINFOPROV C 30 X InfoProvider
I_IOBJNM RSIOBJNM C 30 InfoObject
I_T_RANGE_FILTER RSR_T_RANGESID 0 X Search Authorization with This Filter
I_UNAME SYUNAME C 12 SY-UNAME X ABAP System, User Logon Name

Parameter Reference Type Length Text
E_TSX_AUTH_VALUES_USER_IOBJ RSSB_TSX_AUTH_VALUES_USER_IOBJ h 40 User's Authorized Master Data Value for InfoObject
E_T_MSG RS_T_MSG h 704 BW: Table with Messages (Application Log)
E_T_RANGE RSR_T_RANGESID 0 Authorized Values

Exception Text
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorizations Exist for User
USER_DOESNT_EXIST User Does Not Exist in System
X_MESSAGE Cancellation- Message in Message Handler

Functionality
The functional module fills BI reporting variables in customer exitRSR00001 for multidimensional authorizations.
When automatically filling variables from authorizations, all valuesfrom all user authorizations are collected, and the variables are thenset. With many profiles, this can lead to the user not being able toexecute the query after filling the variables.
With this function module, it is now possible to fill the variablesusing customer exit RSR00001, so that the values come from exactly oneprofile, and the query is executed.

Example
The call up can look like the following in the Customer Exit forReporting variables:
IF i_step = 1.
data: l_t_range_filter type RSR_T_RANGESID,
l_s_range_filter type RSR_s_RANGESID,
l_t_range type RSR_T_RANGESID.
CALL FUNCTION 'RSSB_GET_AUTHS_FILTERED'
EXPORTING
I_IOBJNM = '0COMP_CODE'
I_T_RANGE_FILTER = l_t_range_filter
I_INFOPROV = i_s_cob_pro-infoprov
IMPORTING
E_T_RANGE = e_t_range
* E_TSX_AUTH_VALUES_USER_IOBJ =
EXCEPTIONS
NOT_AUTHORIZED = 1
INTERNAL_ERROR = 2
USER_DOESNT_EXIST = 3
X_MESSAGE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
clear e_t_range.
ENDIF.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF. "step
The following report first sets the filter for characteristic0COMP_CODE and then asks for the suitable value for characteristicZSALE.
*
<(>&<)>----------------------------------------------------------------
-----*
*& Report Z_RSSB_GET_AUTHS_FILTERED*
*&*
*
<(>&<)>----------------------------------------------------------------
-----*
*&*
*&*
*
<(>&<)>----------------------------------------------------------------
-----*
REPORT Z_RSSB_GET_AUTHS_FILTERED .
type-pools: rsr.
data: l_uname type syuname value 'BTEST'.
data: l_t_range_filter type RSR_T_RANGESID,
l_s_range_filter type RSR_s_RANGESID,
l_t_range type RSR_T_RANGESID.
* filter 0COMP_CODE
l_s_range_filter-sign = 'I'.
l_s_range_filter-opt = 'EQ'.
l_s_range_filter-low = '10'.
append l_s_range_filter to l_t_range_filter.
CALL FUNCTION 'RSSB_GET_AUTHS_FILTERED'
EXPORTING
I_IOBJNM = '0COMP_CODE'
I_T_RANGE_FILTER = l_t_range_filter
I_CLEAR = RS_C_true
I_UNAME = l_uname
EXCEPTIONS
NOT_AUTHORIZED = 1
INTERNAL_ERROR = 2
USER_DOESNT_EXIST = 3
X_MESSAGE = 4.
IF SY-SUBRC <> 0.
* todo
ENDIF.
* get the corresponding value for ZSALE
CALL FUNCTION 'RSSB_GET_AUTHS_FILTERED'
EXPORTING
I_IOBJNM = 'ZSALE'
I_UNAME = l_uname
IMPORTING
E_T_RANGE = l_t_range
EXCEPTIONS
NOT_AUTHORIZED = 1
INTERNAL_ERROR = 2
USER_DOESNT_EXIST = 3
X_MESSAGE = 4.
IF SY-SUBRC <> 0.
* todo
ENDIF.

Notes
The authorized values are internally stored in the function module foreach call-up with InfoObject i_iobjnm. If no filters are specified inI_T_RANGE_FILTER, then the first profile is used with the firstcall-up.
The user authorizations are alphabetically sorted after the one-timereading with the first call-up. Therefore, you can use theauthorization names to control which one is used for filling.
With the second and all subsequent call-ups, the already specifiedvalues are used as a filter so that only those authorizations areconsidered that result in a valid profile with the already includedvalues in the e_t_range.
With the I_T_RANGE_FILTER parameter, it is also possible to selectspecific profiles, for example, in which you specify a filter that onlyfits a specific profile in the first call-up.