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: 

Disable access to TCODES

0 Kudos

Hello All,

I want to lock several TCODES for all users for a time period till batch process is in execution.

I found out that changing value in field CINFO of table TSTC from '80' to 'A0', this would lock the transaction.

But i wanted to lock TCODES for all users except one user this user calls TCODES in batch process.
if the TCODE is locked for this particular user then batch process will not execute.

can by any code we can restrict tcodes except for one user?

Thanks,

Rishabh

1 ACCEPTED SOLUTION

former_member226419
Contributor
0 Kudos

This message was moderated.

5 REPLIES 5

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Rishabh,

It can be achieved using authorization object.

Create a authorization object for Tcode and assign that object based on the user.

Arivazhagan S.

former_member226419
Contributor
0 Kudos

This message was moderated.

former_member187748
Active Contributor
0 Kudos

Hi Rishabh,

talk to your basis team, they will create a object , where they have to assign the tcode and its related

activities for those user he wants to provide access to that code,

and you can provide a check based on AUTHORITY CHECK OBJECT,

Then you can use following codes to restrict other users, if they have not given authority in zobject for the same transaction, you have to change these code lines according to your use.

  IF SY-TCODE = 'Your tcode' .

    AUTHORITY-CHECK OBJECT 'zobject'                              

                     ID 'ACTVT' FIELD '01'

                               id 'ACTVT' field '02'

                               id 'ACTVT' field '03'

                                ID 'WERKS' FIELD VBAP-WERKS.

    IF SY-SUBRC EQ 0.

     Message 'You are authorised' TYPE 'I'.

    ELSE.

MESSAGE 'YOU ARE NOT AUTHORISED ' TYPE 'E'.

  

          ENDIF.

    ENDIF.

 

0 Kudos

Hi Sanjeev,

Thanks for the reply
by creating an authorization object this would be a permanent solution this would restrict users all the time. but i wanted to restrict till the time period the batch is running after the batch is completed all users should have access to these TCODES,
can this be done by code which can be run in background parallel with batch process and it would restrict then till the batch is in process.

eperez_gilm
Explorer
0 Kudos

Hi,
Use Transaction SM01