Sometimes your user able to run transaction via indirect method even if your user is not authorized to run that’s transaction. For example you have started transaction ME22N and double click on material number .
In MM03 Transaction is called indirectly from transaction ME22N therefore you’d want to lock or manage transaction MM03. to manage an authorization check you can use transaction SE97 to maintain TDCOUPLES table.
Enter ME22N in Transaction code, then click Execute, then new screen will appear. In this screen you can Check Indicator to X and Message Type for W,S or E.