Transaction codes executable for user
I want a function module which says whether a user acess to particular transaction code.
I am using this FM, but it says the user has authorization to a particular transaction code although he/she is not having access to that transaction
CALL FUNCTION 'SUSR_AUTHORITY_CHECK_SIMULATE'
user_name = usr21-bname
object = 'S_TCODE'
field1 = 'TCD'
val1 = lv_tcode_val ( transaction is ME21N)
sy_subrc = lv_rc
not_authorized = 1
user_not_exists = 2
internal_error = 3
OTHERS = 4.
can anybody tell how to handle this situation?