!--a11y-->
When starting a query, data selection can automatically follow user authorization. You need to use variables here. Since the variables are filled automatically, these must not be entry-ready. As a result, they do not appear in the variable screen. It is thus possible to start a query and to adjust authorizations, without the user having to do anything.
In variable maintenance, choose Processing from Authorization. Here, the variable is automatically filled with the values in the user authorizations. This applies not only to selection variables (characteristic values) but also to node variables.

Do not use single value- or interval variables, because these can only contain exactly one value or interval respectively.
You can find additional information under
Authorization.
You can process all variable types (characteristic value variables, hierarchy node variables, formula- and text variables) using the processing type Customer Exit. Do this by choosing SAP enhancement RSR00001. This is the usual method in BW reporting. Also refer to
Processing using a Customer Exit.
If you need the authorized values or hierarchy nodes, 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 node at the top of the permitted hierarchy section, as well as all permitted sub-areas. You should only use this module in special cases. This is because it uses the internal display of the hierarchy and nodes.
You can find additional information under
Authorizations with Variables.You can use the characteristic 0TCTUSERNM with the variable 0TCTUSEE, which are always filled with an SAP exit with the user name (sy-uname). The user name is set (no entry field) and is rechecked in the authorization check. You only need one authorization with the variables for all users (lower maintenance load). The user also safeguards data when the query is changed.
You can find additional information under
Using Existing AuthorizationsThe variable can also be filled using the result from another query.
Use here the functions of the
Report-Report Interface. Also refer to Using Existing Authorizations.