How to Lock Transaction Code (T-code) in SAP S4 Hana

In this blog you will know How to Lock Transaction Code(T-code) Individual in the SAP System by using T-code SM01_CUS and SM01_DEV

Symptom

You use transaction SM01 to lock the start of individual transactions in the system.

The lock of the transaction start is a property of the transaction definition (workbench object) but is not subject to automatic transport recording.

In the absence of technical support, you must take the following aspects into account from an organizational point of view:

If you import transaction definition data (transaction, SE22 data, SE97) into a system, the lock status of the source system is imported, too.

This must be taken into account in the source system and in the target system and perhaps also during manual import postprocessing.

Solution

Implement the attached kernel corrections and ABAP corrections.

Explanation of the solution

Now, for the lock of the application start, a distinction is made between the global lock of the workbench object and the local lock as a customizing setting.

Transactions SM01 and S_ALR_87101283 and the report RSAUDITC are now obsolete and are replaced by transactions SM01_DEV and SM01_CUS in dialog mode.

Transaction SM01_DEV is for the maintenance of the global application start lock and now has an obligatory connection to the automatic transport recording of the workbench. Software manufacturers (SAP and partner solutions) are typical users of this transaction.

Transaction SM01_CUS is for the maintenance of the local application start lock and is connected to the automatic transport recording of cross-client customizing. For reasons of compatibility with the previous solution, local maintenance is the “current setting”.
If transaction SM01_CUS is called in client 000, a differentiation can be made between setting the lock for all clients or setting the lock for a specific client. If you call it in other clients, you can set the lock for only that client.

Both lock types are displayed in the Audit Information System for locking the application start (report RSAUDITC_BCE) and in the new dialog transactions.

If users attempt to call a locked transaction, they receive an error message that includes the lock reason (globally or locally locked). The change to the lock status can be logged with the Security Audit Log events AUP and AUQ. The lock type has been added here.


For a restricted time, SM01 will remain in its previous state in the background. If you use jobs or scripts for the transaction start lock, change these over during the import of support packages or during upgrades. The method CL_SAIS_APPL_LOCK=>API_SET_START_LOCK( ) is available for locking the application start.
The method CL_SAIS_APPL_LOCK=>API_GET_START_LOCK( ) is available for the application start lock reporting tools.

Example: – Locking T-code.

Run the T-code SM01_CUS

How to Lock Transition Code (T-code) in SAP S4 Hana

Locking ME21N T-code as shwon in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Execute (F8)

select T-code ME21N and click lock as shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Select Client 300 and click on right icon as shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Now Locked Trasaction

How to Lock Transition Code (T-code) in SAP S4 Hana

Go to back one step

and untick from Not Locked box and tick apply on locked box, Execute (F8) as shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Now you can see locked status as shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Now you run T-code ME21N, you Got the message that “Transaction M21N is locked (local customizing lock)”

As shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana

Example 2: – Unlock T-code ME21N

Run the T-code SM01_CUS

Follow the same as shown in below image.

How to Lock Transition Code (T-code) in SAP S4 Hana
How to Lock Transition Code (T-code) in SAP S4 Hana

Leave a Comment