sapdev logo background
sapdev logo sapdev logo
Comments

Run tcode without authorisation




If you are not authorised to run a particular SAP transaction you can still execute it via the use of the debugger. Obvioulsy care needs to be taken that you know what you are doing with the transaction in question, but there are many instances when this method can not only be useful but a life saver. Plus I believe any changes made during debugging are, or at least can be recorded in a log somewhere. The process for getting past the debug authority is as follows:

Step 1 - Insert debug breakpoint
Within Function module 'AUTH_CHECK_TCODE' insert a break-point the ABAP code line 'if sy-subrc = 0.', straight after the call 'AUTH_CHECK_TCODE' id 'TCODE' field tcode command.


Step 2 - Execute your desired SAP transaction code
Execute your tcode and SAP should go into debugging mode and stop at your break point. If it doesn't type /h into the command line field(where you enter transactions) and press enter, then try executing your transaction code again. If it stops at a point which is not where you inserted the breakpoint in step 1 keep pressing F8 until it gets to it!

Step 3 - Change SY-SUBRC value
When the code reaches the 'if sy-subrc = 0' statement, sy-subrc should have a value not equal to 0 if you are not authorised for this transaction. Change this to 0 using the usual method relevant to your system (i.e. by clicking on the change pencil icon, change value and press enter). When value is changed press F8 to continue the SAP program on its way.





Other methods
Thanks for the contribution Sanjay an alternative method could be to use function modules ALINK_CALL_TRANSACTION or C160_TRANSACTION_CALL passing the required tcode. It all depends what authorisations you do have as you may not be able to execute function modules directly or have the ability to change values in debug mode outlined in method 1.




comments powered by Disqus