09-24-2014 6:29 AM
hello all,
i have designed screen with buttons,
on selecting the button a Z-Transaction is called...
here my requirement is, only those users who have authorization should be able to execute that transaction
for others it should display message "you are not authorized to use this transaction'.
how do i achieve this....
09-24-2014 6:30 AM
Hello Vinay Reddy.
You need to use AUTHORITY-CHECK OBJECT statement.
Regards.
09-24-2014 6:37 AM
hi arun,
case 'save_ok'.
when 'xxx'.
call transaction 'ZFI01'.
endcase.
here where do i need to use AUTHORITY-CHECK OBJECT
09-24-2014 6:43 AM
You need to use the statement before calling transaction.
Refer this sample.
AUTHORITY-CHECK OBJECT 'S_TCODE' ID 'TCD' FIELD 'TCODE_NAME'.
IF sy-subrc = 0.
CALL TRANSACTION 'TCODE_NAME' .
ELSE.
MESSAGE 'You are not authorized to use this transaction TCODE_NAME'
TYPE 'S'.
ENDIF.
09-24-2014 6:39 AM
Check authorization before displaying the buttob or executing the transaction.
You can use FM AUTHORITY_CHECK_TCODE to always check authorization /or/ create a record into table TCDCOUPLES (SE97) for each couple of transactions caller/called, as an implict authority check will be executed during CALL TRANSACTION if a record exists and field OKFLA has the value "X" or is empty.
Regards,
Raymond