01-07-2014 5:01 AM
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
01-07-2014 5:14 AM
01-07-2014 5:11 AM
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.
01-07-2014 5:14 AM
01-07-2014 5:26 AM
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.
01-07-2014 5:54 AM
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.
12-06-2021 4:26 PM