Skip to Content

OVERVIEW

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.

TOOLS

SAP BW 7.3, Bex Query Designer

SOLUTION

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.

STEP BY STEP

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.

/wp-content/uploads/2015/12/1_854439.jpg

The settings of the second variable are:

/wp-content/uploads/2015/12/2_854451.jpg/wp-content/uploads/2015/12/3_854452.jpg

b) Create a Z-table

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

/wp-content/uploads/2015/12/4_854453.jpg

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.

        CALL FUNCTION ‘SRM_VE_CONVERT_DATETIME_TO_TS’
          EXPORTING
            IV_DATE             = sydatum
            IV_TIME             = syuzeit
            IV_TIME_ZONE        = ‘CET’
         IMPORTING
           EV_TIMESTAMP        = timestamp
*         EV_TIMESTAMPL       = timestamp
*       EXCEPTIONS
*         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.
        ENDLOOP.

    ENDCASE.

ENDCASE.

RESULT

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

/wp-content/uploads/2015/12/5_854454.jpg

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply