‎2008 Jun 05 12:06 PM
hi
i wand to check authorization before select statement not in selection-screen, can any one send me coding for this.
mani.r
‎2008 Jun 05 12:07 PM
‎2008 Jun 05 12:19 PM
Call this function module with TCODE as the input befoer your select statement
CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
tcode = tcode
EXCEPTIONS
ok = 0
not_ok = 1.
IF sy-subrc NE 0.
MESSAGE e059(eu) WITH tcode.
ENDIF.
If you are trying to get data from Infotypes through select query, you can use the function module
HR_READ_INFOTYPE
It will take care of authorizations
Reward points please
‎2008 Jun 05 12:26 PM
‎2008 Jun 05 12:29 PM
can you explain more on your requirement
What field, where is the field (in which TCODE)
Why are you trying to check authorization
‎2008 Jun 05 12:33 PM
hi
i dont want to check the authorization in at selection-screen level. i want to check the object and field in selection level. for eg vtweg in v_kna1_vko.
thanks
mani.r
‎2008 Jun 05 12:28 PM
Hi,
You can use this sample code:
at selection-screen output.
if sy-uname <> 'Some_User'.
message 'No Authorization'.
endif.
OR
"You can use authority check object.
Thanks,
Sriram Ponna.