Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Execute authorization on transactions.

Former Member
0 Kudos

I want to find out if a set of users has the authorization to execute a particular transaction.

I want to write a list of the same.

More specifically I am looking for a function module which can give me this.

16 REPLIES 16

Former Member
0 Kudos

<deleted>

Former Member
0 Kudos

Hi,

Look at below FM

SUSR_GET_PROFILES_OF_USER

SUSR_GET_PROFS_WITH_SPEC_PROFS

SUSR_GET_TCODES_AUTH_S_TCODE

SUSR_GET_TCODES_WITH_AUTH

SUSR_GET_TCODES_WITH_OBJ

Regards

Amole

Former Member
0 Kudos

Hi ,

Please check this <a href="http://www.guidancetech.com/people/holland/sap/abap/zzbgs092.htm">Link</a> .This will give a program which give overview of profiles and authorizations.

Hope This Info Helps YOU.

<i>

Reward Points If It Helps YOU.</i>

Regards,

Raghavendra

Former Member
0 Kudos

Hi gerson,

you can get list of tcode executable for user with this report RSUSR01. hope this help you.

regards,

John

0 Kudos

Deleted

Message was edited by: Stephan Kaminski

0 Kudos

did it work Gibson ?

Former Member
0 Kudos

Stephen,

This actually has not worked. If returns successful in both cases i.e. even if you have or dont have the authorization to a transaction.

Could you help

Regards

Gerson

0 Kudos

Deleted

Message was edited by: Stephan Kaminski

0 Kudos

small correction to stephan's code,

It should be sy-subrc = 0 , i think.

0 Kudos

Hi Ravi,

If it is diff to 0 then the user is not allowed

0 Kudos

Ravi,

Indeed, if it is 0, user is allowed

0 Kudos

lolz..'change the specification according to your code..'..:)..

0 Kudos
REPORT  ztest_sidskai4                          .


PARAMETERS : p_usr TYPE xubname.
PARAMETERS : p_tcode TYPE tcode.

START-OF-SELECTION.


  DATA : value TYPE ust12-von .
  DATA : text TYPE tstct-ttext.

  value = p_tcode.

  CALL FUNCTION 'AUTHORITY_CHECK'
    EXPORTING
      user                = p_usr
      object              = 'S_TCODE'
      field1              = 'TCD'
      value1              = value
    EXCEPTIONS
      user_dont_exist     = 1
      user_is_authorized  = 2
      user_not_authorized = 3
      user_is_locked      = 4
      OTHERS              = 5.
<b>  IF sy-subrc = 2.
    SELECT SINGLE ttext
      INTO text
      FROM tstct
      WHERE tcode = value AND sprsl = sy-langu.
    WRITE : / value , text.
    MESSAGE s016(rp) WITH 'ALLOW |' p_usr value text.
  ELSEIF sy-subrc = 3.
    SELECT SINGLE ttext
      INTO text
      FROM tstct
      WHERE tcode = value AND sprsl = sy-langu.
    MESSAGE s016(rp) WITH 'NOT ALLOW |' p_usr value text.

  ENDIF.</b>

0 Kudos

Test should look like this :

  
      EXCEPTIONS
        user_dont_exist     = 1
        user_is_authorized  = 2
        user_not_authorized = 3
        user_is_locked      = 4
        OTHERS              = 5.
  IF sy-subrc = 2.
    SELECT SINGLE ttext
      INTO text
      FROM tstct
      WHERE tcode = value AND sprsl = sy-langu.
    WRITE : / value , text.
    MESSAGE s016(rp) WITH 'ALLOW |' p_usr value text.
  ELSEIF sy-subrc = 3.
    SELECT SINGLE ttext
      INTO text
      FROM tstct
      WHERE tcode = value AND sprsl = sy-langu.
    MESSAGE s016(rp) WITH 'NOT ALLOW |' p_usr value text.
 
  ENDIF.

Former Member
0 Kudos

does it work better now ?

0 Kudos

Is the problem solved ?