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

authorization object

Former Member
0 Likes
863

i have developed program "ZCRMR3_UPDATE_FIELDS" and i have also created authorization object "ZCR3". I want to restrict some users from executing this program so how to attach authorization object ZCR3 to program so as to prevent users from executing this program.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
789

Hi,

use the function module as specified below.

CALL FUNCTION 'SUSR_USER_LOGONDATA_GET'

EXPORTING

user_name = sy-uname

IMPORTING

user_logondata = l_uslogond

EXCEPTIONS

user_name_not_exist = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF l_uslogond-class NOT IN r_class.

MESSAGE e882(e1) WITH sy-uname.

ENDIF.

before using this function module build the ranges r_class where r_class-low = the authorisation object that u have created.

Reward points if useful.

Regards,

Sowmya.

6 REPLIES 6
Read only

Former Member
0 Likes
790

Hi,

use the function module as specified below.

CALL FUNCTION 'SUSR_USER_LOGONDATA_GET'

EXPORTING

user_name = sy-uname

IMPORTING

user_logondata = l_uslogond

EXCEPTIONS

user_name_not_exist = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF l_uslogond-class NOT IN r_class.

MESSAGE e882(e1) WITH sy-uname.

ENDIF.

before using this function module build the ranges r_class where r_class-low = the authorisation object that u have created.

Reward points if useful.

Regards,

Sowmya.

Read only

Former Member
0 Likes
789

Hi,

use this function module in at selection-screen event.

Regards,

Sowmya.

Read only

Former Member
0 Likes
789

Hi santosh,

while creating the T.Code for that particular program in se93 transaction there it asks for authorization object.

Read only

Former Member
0 Likes
789

when i am adding authorization object in transaction code through SE93, it is giving following error

"Check object has not been maintained (Press enter to reset)

Read only

Former Member
0 Likes
789

hi Sowmya,

How to add this function in at selection, because when i am adding this to at selection it is giving error as

"statement is not accessible"

Read only

0 Likes
789

Hi,

AT SELECTION-SCREEN.

Perform authority_check.

in that form add the code what i have mentioned.

This should solve ur problem i guess.

Regards,

Sowmya.