‎2006 Aug 14 6:25 PM
Hi,
How can i check if a user has authorization in sapscript?. Sample code will help.
Thanks,
Sandeep
‎2006 Aug 14 6:30 PM
In SAPSCRIPT, the checks are valid only for st texts..PL check this <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/d6/0db682494511d182b70000e829fbfe/frameset.htm">SAP Help</a> for more info..
~Suresh
‎2006 Aug 14 6:34 PM
Hi,
You can use the perform statement to check for authorization.
http://help.sap.com/saphelp_46c/helpdata/EN/d1/803048454211d189710000e8322d00/frameset.htm
Hope this works..
Thanks,
Naren
‎2006 Aug 14 6:44 PM
If you want to programmaticlly check whether another user is authorized for editing sapscript forms, then you can use the following code.
report zrich_0001.
parameters: p_uname type sy-uname.
data: subrc type sy-subrc.
call function 'SUSR_AUTHORITY_CHECK_SIMULATE'
exporting
user_name = p_uname
object = 'S_SCRP_FRM'
field1 = 'FORMNAME'
val1 = '*'
field2 = 'LANGUAGE'
val2 = 'E'
field3 = 'ACTVT'
val3 = '02' "Edit Mode
importing
sy_subrc = subrc
exceptions
not_authorized = 1
user_not_exists = 2
internal_error = 3
others = 4.
if subrc <> 0.
write:/ 'User is not authorized for editing sapscripts'.
else.
write:/ 'User is authorized for editing sapscripts'.
endif.
Regards,
Rich Heilman
‎2006 Aug 14 7:17 PM
Rich,
I want to restrict on users how can run the sapscript.
Sandeep