‎2008 Mar 20 11:20 AM
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.
‎2008 Mar 20 11:28 AM
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.
‎2008 Mar 20 11:28 AM
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.
‎2008 Mar 20 11:35 AM
Hi,
use this function module in at selection-screen event.
Regards,
Sowmya.
‎2008 Mar 20 11:36 AM
Hi santosh,
while creating the T.Code for that particular program in se93 transaction there it asks for authorization object.
‎2008 Mar 20 11:42 AM
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)
‎2008 Mar 20 11:46 AM
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"
‎2008 Mar 20 11:54 AM
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.