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: 

a prg to do authorisation check

Former Member
0 Kudos
113

hi,

The reports need to be restricted to BU that means the reports have to check the profile of the user with the parameter plant

1 ACCEPTED SOLUTION

Former Member
0 Kudos
69

hi,

the steps to do authorizationn check are,

1. Authorization fields are created under Tools -


> ABAP Workbench ---> Development -


> Other tools -


> Authorization objects -


> Fields (transaction SU20).

2. create an authorization object (here S_TRVL_BKS ) and assign the authorization object to an object class.

3. Authorization Objects are created under Tools ABAP Workbench Development -> Other tools--. Authorization objects -


>Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

program:

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

hope this will be helpful.

regards,

praba.

7 REPLIES 7

Former Member
0 Kudos
69

Hi

Use statament AUTHORITY-CHECK to control your authorization object

Max

0 Kudos
69

hi,

you can search auth.-object with transaction S_BCE_68001413

Andreas

Former Member
0 Kudos
69

Hello Josephine,

What u can do is check for the authorisation object which is suitable for your requirement and then in ur report call

AUTHORITY-CHECK OBJECT object

ID name1 FIELD f1

ID name2 FIELD f2

...

ID name10 FIELD f10.

Secondly u can connect the authorisation object in the report attribute then it will resetict the user without proper authorisation to even execute the report.

Former Member
0 Kudos
69

Hi,

You can use authorization objects using authority check statsement:

e.g Checking whether a user has authority for change / display of plant:

AUTHORITY-CHECK OBJECT 'M_EINF_WRK'

ID 'WERKS' FIELD '0002'

ID 'ACTVT' FIELD '02'.

Regards,

Akshay

Former Member
0 Kudos
69

Hi,

Create the Authority Object ( Z_OBJ) using T.Code SU21.

Then Create Authorization field and give permitted activites .

parameter .p_field like ZTABLE-field

authority-check object 'Z_OBJ'

id 'ZDATSRC' field p_field.

if syst-subrc ne 0.

message e0001 with syst-subrc.

endif.

Thanks,

Pramod

Former Member
0 Kudos
70

hi,

the steps to do authorizationn check are,

1. Authorization fields are created under Tools -


> ABAP Workbench ---> Development -


> Other tools -


> Authorization objects -


> Fields (transaction SU20).

2. create an authorization object (here S_TRVL_BKS ) and assign the authorization object to an object class.

3. Authorization Objects are created under Tools ABAP Workbench Development -> Other tools--. Authorization objects -


>Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

program:

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

hope this will be helpful.

regards,

praba.

Former Member
0 Kudos
69

Check the Authority object using tcode S_BCE_68001413.

'S_TCODE'-- Authority Object

'TCD' -- Authorization field

SM35 - tcode on which you want to restrict the authorization

.

authority-check object 'S_TCODE'

id 'TCD'

field 'SM35'.

if sy-subrc ne 0.

  • User does not have authority for transaction SM35!!!

endif.

Thanks,

Pramod