The only way to lock a specific transaction from a specific user is to not assign him the transaction code in the authorization profile of the user.
Please note that there is a way to lock a transaction code via Tcode SM01, but this is a system-wide activity and will lock the Tcode in the entire system.
Dig Deeper on SAP security
Related Q&A from Farooq Ali
SAP BI/BW expert Farooq Ali discusses the differences in the use of SAP Software Deployment Manager (SDM) and SAP Java Support Package Manager (JSPM)... Continue Reading
Find out how resetting a transport buffer can help fix an error that occured during the installation of an SAPGUI patch. Learn how to avoid an ... Continue Reading
Find out how to set a default SAP BI client within an SAP Business Intelligence (BI) system. Learn how to run an SAP Basis TCode in a default SAP BI ... Continue Reading