When a query is started, data can be selected automatically according to the user authorizations. This requires the use of variables. Since the variables are filled automatically, these must not be input ready. As a result, they do not appear on the variable screen. It is thus possible to start a query and to adjust authorizations, without the user having to do anything.
...
1. Filling the Variables Automatically:
In variable maintenance, choose Processing from Authorization. The variable is automatically filled with the values in the authorizations for the user. This applies to selection variables (characteristic values) and also to node variables.
Do not use single value or interval variables, since these can contain one value or interval only.
For more information, see Authorization.
2. Filling the variables in the customer exit:
You can process all variable types (characteristic value variables, hierarchy node variables, hierarchy variables, formula variables, and text variables) using the processing type Customer Exit. Do this by choosing SAP enhancement RSR00001. This is the usual method in BW reporting. See also Processing with Customer Exits.
If you need the authorized values or hierarchy nodes contained in these, use the following function modules:
RSSB_GET_AUTH_FOR_USER returns the permitted single values and intervals.
RSSB_GET_AUTH_HIER_FOR_USER returns the top node of the permitted hierarchy section, as well as all permitted subareas. You should only use this module in special cases. This is because it uses the internal display of the hierarchy and nodes.
For more information, see Authorizations with Variables.
3. Filling Variables with ‘SAP Exit’ or ‘Replacement Path’ Types:
For example, you can use characteristic 0TCTUSERNM with variable 0TCTUSEE, which is always filled with an SAP exit with the user name (sy-uname). This sets the user name (no input-readiness) and rechecks it in the authorization check. To do this, only one authorization with the variables for all users (less maintenance) is required. The data is also protected if the user changes the query.
For more information, see Using Existing Authorizations.
4. Filling Variables Using a Query:
The variable can also be filled using the result from another query.
To do this, you use the functions of the report-report interface. See also Using Existing Authorizations.