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

a prg to do authorisation check

Former Member
0 Likes
1,065

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

Former Member
0 Likes
1,021

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.

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,021

Hi

Use statament AUTHORITY-CHECK to control your authorization object

Max

Read only

0 Likes
1,021

hi,

you can search auth.-object with transaction S_BCE_68001413

Andreas

Read only

Former Member
0 Likes
1,021

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.

Read only

Former Member
0 Likes
1,021

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

Read only

Former Member
0 Likes
1,021

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

Read only

Former Member
0 Likes
1,022

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.

Read only

Former Member
0 Likes
1,021

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