How to Modify the code in Quality or Production Systems?

How to modify any code in Quality or Production without the need for an access key.

Imagine, you are doing a unit test for an object in QA, suddenly a test case fails and oh! come one you have to change this one line again in the development and move it to Quality to test. That will take definitely at least 5 minutes to 30 minutes, depending on how your system is configured. How about changing the code directly in quality and continuing the testing. One little suggestion before we proceed with the tutorial, always use this trick only in quality and not in production or it may create chaos. I work on 4.6c and have not used this trick in all the other SAP versions. Please try it and let me know your comments.

When you click on the change button in quality, you will get a screen like this saying ‘Error in Object Editing’.

Error in editing object

Now, we will work out a way to skip this message and make the change to the code. You will need this handy debugger to start the debugger from a popup.

Drag the debug tool and place it on the above popup. then, Click Continue or Press Enter. This will take you into ABAP Debugger. Click on Call stack button –> double click on Function TRINT_CORR_CHECK. ABAP Debugger
Now click on Fields button and then set a breakpoint on the line LV_SUBRC = SY-SUBRC ( see image below) after the call to the function module ‘TRINT_CORR_CHECK’.

ABAP Debugger 2

Press F8 and the code will stop on the line ‘LV_SUBRC = SY-SUBRC’. Double click on SY-SUBRC and the value must be ’12’ now change the value to ‘0’. Now, press F8 again, this should bring you back to the editor with change mode.

Wait, there is an another step to it. Once you edit the code and make the changes and press activate. The program will again bring you to the same window saying ‘Error in Editing Object’.
Error in editing object

Now, again drag and drop our little Debug Tool. Then click continue or press enter. This will take you to the ABAP Debugger, well this is a similar code, but it’s a different include so you have to carry the steps again. Click on Call stack button –> double click on Function TRINT_CORR_CHECK. Now, you will get a screen like below.

ABAP Debugger 3

Now, set the break-point at line ‘When 0′. Press F8 and now change the value of SY-SUBRC from ’12’ to ‘0’.

Press F8(execute) and now the program will going through a set of break-points set by you. Change the value everytime from ’12’ to ‘0’ and press F8. Finally after three or four execute sy-subrc changes, the program will finally get activate and you will have the new modified code available to execute.

Do you know about the syntax ‘INSERT REPORT‘. We can also modify the code using it.