Skip to Content
Author's profile photo Thomas Debacker

How to log/track filters used within a Bex query.


The requirement is to log/track/record all  information related to the use of a specific Bex query ; the reason is that the query points to very sensitive data.

The access to the data is of course protected by specific rights but the customer wants to be able to determine who access the data, when and also what filters were used. This last information (filters) is not available from standard BW statistics content. Another approach could be to activate logs for that query but it appeared too much complex.


SAP BW 7.3, Bex Query Designer


Install a query tracker through the use of a BEX Customer exit. The customer exit records the data to a ‘Z’ table each time the query is launched.


a) Create 2 variables on each filter to be tracked

The first variable is the user selection (common multiple selection in our case) ; the second one is the tracker.


The settings of the second variable are:


b) Create a Z-table

That could also be a DSO, but I went for a simple table.


c) Write the customer exit

The following code takes place in the RSR00001 enhancement, Function module EXIT_SAPLRRS0_001.

The i_step 2 is reached AFTER the filter selection by the user, so it is possible to use the selection recorded by the first variable (ZV_**********_MULT_SEL).

The second variable (‘V_**********_TRACKER) is just used for reaching the i_step 2


CASE i_vnam.


WHEN ‘ZV_**********_TRACKER’.

    DATA: l_s_var_range TYPE rrrangeexit.
    DATA: user TYPE xubname.
    DATA: timestamp TYPE rsconttimestmp.
    DATA: wa TYPE zbw_msisdn_logs.

    CASE i_step.

      WHEN 1.
        ” Do nothing

      WHEN 2.
        TABLES: zbw_**********_logs.
        user = syuname.

            IV_DATE             = sydatum
            IV_TIME             = syuzeit
            IV_TIME_ZONE        = ‘CET’
           EV_TIMESTAMP        = timestamp
*         EV_TIMESTAMPL       = timestamp
*         CONVERT_ERROR       = 1
*         OTHERS              = 2

        LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam = ‘ZV_**********_MULT_SEL’.
          watimestamp = timestamp.
          wabname     = user.
          wamsisdn    = l_s_var_rangelow.
          wacounter   = 1.
          INSERT zbw_**********_logs FROM wa.




The Z-table contains all selections made against this query.


Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Nice little solution for this requirement and clearly explained!