Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8627

Customer Exit - Analysis Authorization Issue

$
0
0

Hey experts,

 

I’m working on implementing a customer exit for analysis authorization security.  I’m on 7.4 SP5.  I found a couple of SCN guides that walked me through how to implement and I’m facing two issues, both of which I’ll explain below.  Please help!

 

Here’s the background:

 

Z-table in the BW systems: ZCOUNTRY_USER

 

The table has MANDT, UNAME, and COUNTRY in it, all of which are keys.  The users are entered into this table and are assigned a country that they are allowed to view. (Well that’s the goal).

 

I created Exit Variable: ZSLDTO_EX_REG

 

Went into CMOD and did these declarations:

 

*** Declarations for Security Customer Exit ZSLDTO_EX_REG ***

DATA: it_zcountry_user TYPE STANDARD TABLE OF zcountry_user,

      wa_zcountry_user TYPE zcountry_user.

DATA: low_country like loc_var_range-low.

*** End of Declaration for Security Customer Exit ***

 

 

 

 

Then added this following code between the case statement:

WHEN 'ZSLDTO_EX_REG'.

  IF i_step EQ '1'.

  CLEAR wa_zcountry_user.

 

 

  SELECT * FROM zcountry_user INTO TABLE it_zcountry_user WHERE uname = sy-uname.

    IF sy-subrc = 0.

      LOOP AT it_zcountry_user into wa_zcountry_user.

        l_s_range-low  = wa_zcountry_user-country.

        l_s_range-sign = 'I'.

        l_s_range-opt  = 'EQ'.

        APPEND l_s_range TO e_t_range.

        CLEAR: l_s_range , wa_zcountry_user.

      ENDLOOP.

    ENDIF.

   ENDIF.

 

 

 

 

Then added this after the case statement:

*** Validation on BW Security - Variable Screen

  IF i_step EQ '3'.

    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZSLDTO_EX_REG'.

    CLEAR: l_s_range.

    low_country = loc_var_range-low.

 

 

*** Get values if stored in custom mapping table ***

    SELECT SINGLE * FROM zcountry_user INTO wa_zcountry_user

      WHERE country EQ low_country AND uname EQ sy-uname.

 

 

    IF sy-subrc NE 0.

      CALL FUNCTION 'RRMS_MESSAGE_HANDLING'

        EXPORTING

          i_class  = 'RSBBS'

          i_type   = 'E'

          i_number = '000'

          i_msgv1  = 'No authorization for Country - '

          i_msgv2  = loc_var_range-low

          i_msgv3  = ' , Enter different Country or request access.'

          i_msgv4  = sy-uname

        EXCEPTIONS

          OTHERS   = 2.

* raise the exception

      RAISE again.

    ENDIF.

    ENDLOOP.

  ENDIF.

 

 

 

 

 

 

I have assigned the variable ZSLDTO_EX_REG to the Analysis Authorization ZCTR_TEST1, and when I assign the ZCTR_TEST1 Analysis Authorization to the user, I get an error message even before the BW variable screen appears.  Error Messages are different when using different BEx tools, but I don’t even get to the variable screen when I assign the AA to the user.

 

 

When I DON’T assign the Analysis Authorization to the user, I get to execute the query, the value “GB” appears on the variable screen for country as expected.  When I execute the query, I get “No Authorization” and no data is returned.

 

 

I did an authorization trace in rsecadmin and found the info below that is indeed failing on country authorization.

 

 

Let me know if any of you have any ideas as to how to solve please.

 

Thanks


Viewing all articles
Browse latest Browse all 8627

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>