Showing posts with label DEBUG. Show all posts
Showing posts with label DEBUG. Show all posts

Wednesday, November 16, 2011

How to skip any authority check

If you are allowed to debug a SAP system, you can easily skip any authority check that avoids you to execute a program or transaction. You only have to follow these steps:
  1. Execute command /H in command field before executing the transaction/report with authority checks to skip
  2. You will receive a message saying that debugging has been switched on
    If you don't receive this message, you are not allowed to debug and unfortunately you won't be able to apply this trick
  3. Execute the transaction/report. ABAB debugger will be launched.
  4. In the menu bar select Breakpoints --> Breakpoint at --> Statement...
  5. In the popup window write authority-check and accept (enter)
  6. F8 to continue with the execution. The execution will stop when first authority-check statement is reached. For example:
  7. F5 to execute the statement and check if system variable sy-subrc has a value not equal to 0.
  8. If it has a value not equal to 0, this means that you don't have authorization for this authority check and that you will be allowed to go on with the execution. If it is 0, F8 to go on until the next authority-check statement.
  9. When you reach an authority-check and execute it and sy-subrc has a  value not equal to 0, then you will have to update sy-subrc to 0 in order to be allowed to go on with the execution. To do this, just write sy-subrc in one of the field-names fields
  10. and overwrite variable's value to 0 in the field at the right and press the button with the pencil
  11. F8 to go on. You will have to repeat previous steps in all authority-check statements reached where sy-subrc is valuated to non 0 value when it is executed

Tuesday, September 6, 2011

How to debug pop-up window

The okcode field is deactivated when a modal window (the technical name of popup windows) is displayed, so it seems impossible to enter the debugger (using /H okcode).

In common dialogs, the okcode field is available, so you can type /H to enter debug mode:
however,  it is not available in modal windows (we see it but we can't enter anything in it):

The solution is to create on the frontend a SAPGUI shortcut (file with extension .SAP), of type System Command and command /H, and drag and drop it from Windows desktop to the SAP modal window. You can create the SAPGUI shortcut as explained here:

- Click on the Create shortcut icon on a the toolbar in a SAPGUI session

- In the popup window enter teh values you need, in this case Type = System Command and Command = /H

- Press Finish and a shortcut on the Desktop (or the location you entered) will be created