Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to prevent users from calling un authorized transactions (in module pool screen)

former_member185116
Active Participant
0 Kudos

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....

4 REPLIES 4

karun_prabhu
Active Contributor
0 Kudos

Hello Vinay Reddy.

     You need to use AUTHORITY-CHECK OBJECT statement.

Regards.

0 Kudos

hi arun,

case 'save_ok'.

when 'xxx'.

call transaction 'ZFI01'.

endcase.

here where do i need to use AUTHORITY-CHECK OBJECT

0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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