Application Development and Automation 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: 
Read only

Execute authorization on transactions.

Former Member
0 Likes
1,868

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
Read only

Former Member
0 Likes
1,775

<deleted>

Read only

Former Member
0 Likes
1,775

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

Read only

Former Member
0 Likes
1,775

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

Read only

Former Member
0 Likes
1,775

Hi gerson,

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

regards,

John

Read only

0 Likes
1,775

Deleted

Message was edited by: Stephan Kaminski

Read only

0 Likes
1,775

did it work Gibson ?

Read only

Former Member
0 Likes
1,775

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

Read only

0 Likes
1,775

Deleted

Message was edited by: Stephan Kaminski

Read only

0 Likes
1,775

small correction to stephan's code,

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

Read only

0 Likes
1,775

Hi Ravi,

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

Read only

0 Likes
1,775

Ravi,

Indeed, if it is 0, user is allowed

Read only

0 Likes
1,775

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

Read only

0 Likes
1,775
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>
Read only

0 Likes
1,775

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.

Read only

Former Member
0 Likes
1,775

does it work better now ?

Read only

0 Likes
1,775

Is the problem solved ?